pkg/plugins: rename max/min as it collides with go1.21 builtin

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit df2f25a977)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-26 19:43:21 +02:00
parent 710c748801
commit 0b97ecddb0
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -227,13 +227,13 @@ func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool,
}
func backoff(retries int) time.Duration {
b, max := 1, defaultTimeOut
for b < max && retries > 0 {
b, maxTimeout := 1, defaultTimeOut
for b < maxTimeout && retries > 0 {
b *= 2
retries--
}
if b > max {
b = max
if b > maxTimeout {
b = maxTimeout
}
return time.Duration(b) * time.Second
}