Skip to content

Commit aa69c27

Browse files
authored
Merge pull request #3 from wiz-sec/danny/WZ-42693-use-retry-after-only-if-lower-than-max
danny/WZ 42693 use retry after only if lower than max
2 parents c289502 + ad73a27 commit aa69c27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,9 @@ func DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response)
552552
if resp != nil {
553553
if resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode == http.StatusServiceUnavailable {
554554
if sleep, ok := parseRetryAfterHeader(resp.Header["Retry-After"]); ok {
555-
return sleep
555+
if sleep <= max {
556+
return sleep
557+
}
556558
}
557559
}
558560
}

0 commit comments

Comments
 (0)