Skip to content

Commit

Permalink
feat: add status 429 to default retry policy
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlGW committed May 7, 2024
1 parent 8b3c744 commit df7a82a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/httpr/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ func defaultRetry(r *http.Response, err error) bool {
return true
}
switch r.StatusCode {
case 0, http.StatusInternalServerError, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout:
case 0:
return true
case http.StatusTooManyRequests:
return true
case http.StatusInternalServerError, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout:
return true
}
return false
Expand Down

0 comments on commit df7a82a

Please sign in to comment.