Skip to content

Commit

Permalink
Retry HTTP requests when receiving 429 (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Nov 20, 2023
1 parent 93c64fa commit a4c0557
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (jc *HttpClient) Send(method, url string, content []byte, followRedirect, c
if resp == nil {
return false, errorutils.CheckErrorf("%sReceived empty response from server", logMsgPrefix)
}
// If response-code < 500, should not retry
if resp.StatusCode < 500 {
// If response-code < 500 and it is not 429, should not retry
if resp.StatusCode < 500 && resp.StatusCode != http.StatusTooManyRequests {
return false, nil
}
// Perform retry
Expand Down

0 comments on commit a4c0557

Please sign in to comment.