Skip to content

Commit

Permalink
Undoing retry policy change
Browse files Browse the repository at this point in the history
  • Loading branch information
cranktakular committed Feb 20, 2024
1 parent 529f7f3 commit 8bb2561
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions exchanges/request/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ func DefaultRetryPolicy(resp *http.Response, err error) (bool, error) {
}

if resp.StatusCode == http.StatusTooManyRequests {
// If we've sent too many requests, we shouldn't immediately retry.
return false, nil
return true, nil
}

if resp.Header.Get(headerRetryAfter) != "" {
Expand Down
2 changes: 1 addition & 1 deletion exchanges/request/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestDefaultRetryPolicy(t *testing.T) {
},
"Too Many Requests": {
Args: args{Response: &http.Response{StatusCode: http.StatusTooManyRequests}},
Want: want{Retry: false},
Want: want{Retry: true},
},
"Not Found": {
Args: args{Response: &http.Response{StatusCode: http.StatusNotFound}},
Expand Down

0 comments on commit 8bb2561

Please sign in to comment.