Skip to content

Commit

Permalink
client: retry add 3xx and 404
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Apr 25, 2024
1 parent dc8b2e1 commit b804cf4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/clientv2/interceptor_retry_simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,18 @@ func isResponseRetryable(resp *http.Response) bool {
}

func isStatusCodeRetryable(statusCode int) bool {
if statusCode < 500 {
if statusCode < 300 {
return false
}

if statusCode < 400 {
return true
}

if statusCode < 500 {
return statusCode == 404
}

if statusCode == 501 || statusCode == 509 || statusCode == 573 || statusCode == 579 ||
statusCode == 608 || statusCode == 612 || statusCode == 614 || statusCode == 616 || statusCode == 618 ||
statusCode == 630 || statusCode == 631 || statusCode == 632 || statusCode == 640 || statusCode == 701 {
Expand Down

0 comments on commit b804cf4

Please sign in to comment.