Skip to content

Commit

Permalink
fix: Return an error when the service response Unauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny-Wei committed Jul 8, 2024
1 parent 3534ce2 commit d8028ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func httpsPostWithRetryAndToken(reqBody []byte, debug bool, service string, name
// try update token
updateChan <- true
}
return fmt.Errorf(fmt.Sprintf("http error code %d", httpRsp.StatusCode))
default:
err = fmt.Errorf(fmt.Sprintf("http error code %d", httpRsp.StatusCode))
}
Expand Down Expand Up @@ -148,7 +149,7 @@ func httpPostAndGetResponseWithRetry(reqBody []byte, debug bool, service string,
err = fmt.Errorf(fmt.Sprintf("http error code %d", httpRsp.StatusCode))
}
}
r := rand.Intn(10)
r := rand.Intn(60) + 20
time.Sleep(time.Duration(r) * time.Millisecond)
}

Expand Down

0 comments on commit d8028ed

Please sign in to comment.