MCPcopy Create free account
hub / github.com/imroc/req / SetCommonRetryBackoffInterval

Method SetCommonRetryBackoffInterval

client.go:1419–1422  ·  view source on GitHub ↗

SetCommonRetryBackoffInterval set retry to use a capped exponential backoff with jitter for requests fired from the client. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

(min, max time.Duration)

Source from the content-addressed store, hash-verified

1417// with jitter for requests fired from the client.
1418// https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
1419func (c *Client) SetCommonRetryBackoffInterval(min, max time.Duration) *Client {
1420 c.getRetryOption().GetRetryInterval = backoffInterval(min, max)
1421 return c
1422}
1423
1424// SetCommonRetryHook set the retry hook which will be executed before a retry.
1425// It will override other retry hooks if any been added before.

Callers 3

TestRetryOverrideFunction · 0.80

Calls 2

getRetryOptionMethod · 0.95
backoffIntervalFunction · 0.85

Tested by 2

TestRetryOverrideFunction · 0.64