Skip to content

Commit

Permalink
fix retry logic to retry when status code >= 500
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoxu committed Nov 19, 2024
1 parent b0f1f8d commit 8d3a171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (l *intervalRequest) RoundTrip(r *http.Request) (*http.Response, error) {
return nil, err
}
// This may be the result of a timeout. we need to reset the body. and retry.
for i := 0; i < l.retry && resp.StatusCode == http.StatusBadGateway; i++ {
for i := 0; i < l.retry && resp.StatusCode >= http.StatusInternalServerError; i++ {
io.Copy(io.Discard, resp.Body)
resp.Body.Close()
time.Sleep(l.interval)
Expand Down

0 comments on commit 8d3a171

Please sign in to comment.