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

Method SetRetryBackoffInterval

request.go:1195–1198  ·  view source on GitHub ↗

SetRetryBackoffInterval set retry to use a capped exponential backoff with jitter. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

(min, max time.Duration)

Source from the content-addressed store, hash-verified

1193// SetRetryBackoffInterval set retry to use a capped exponential backoff with jitter.
1194// https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
1195func (r *Request) SetRetryBackoffInterval(min, max time.Duration) *Request {
1196 r.getRetryOption().GetRetryInterval = backoffInterval(min, max)
1197 return r
1198}
1199
1200// SetRetryHook set the retry hook which will be executed before a retry.
1201// It will override other retry hooks if any been added before (including

Callers 2

TestRetryBackOffFunction · 0.80
SetRetryBackoffIntervalFunction · 0.80

Calls 2

getRetryOptionMethod · 0.95
backoffIntervalFunction · 0.85

Tested by 1

TestRetryBackOffFunction · 0.64