Skip to content

Commit

Permalink
Merge pull request #7 from DaoCloud-OpenSource/master
Browse files Browse the repository at this point in the history
fix retry logic to retry when status code >= 500
  • Loading branch information
wzshiming authored Nov 19, 2024
2 parents b0f1f8d + 8d3a171 commit 2a385ae
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 2a385ae

Please sign in to comment.