diff options
Diffstat (limited to 'vendor/golang.org/x/crypto/acme/http.go')
| -rw-r--r-- | vendor/golang.org/x/crypto/acme/http.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/vendor/golang.org/x/crypto/acme/http.go b/vendor/golang.org/x/crypto/acme/http.go index d92ff232f..8f29df56e 100644 --- a/vendor/golang.org/x/crypto/acme/http.go +++ b/vendor/golang.org/x/crypto/acme/http.go @@ -66,7 +66,7 @@ func (c *Client) retryTimer() *retryTimer { // The n argument is always bounded between 1 and 30. // The returned value is always greater than 0. func defaultBackoff(n int, r *http.Request, res *http.Response) time.Duration { - const max = 10 * time.Second + const maxVal = 10 * time.Second var jitter time.Duration if x, err := rand.Int(rand.Reader, big.NewInt(1000)); err == nil { // Set the minimum to 1ms to avoid a case where @@ -86,10 +86,7 @@ func defaultBackoff(n int, r *http.Request, res *http.Response) time.Duration { n = 30 } d := time.Duration(1<<uint(n-1))*time.Second + jitter - if d > max { - return max - } - return d + return min(d, maxVal) } // retryAfter parses a Retry-After HTTP header value, |
