MCPcopy
hub / github.com/bsm/redislock / LimitRetry

Function LimitRetry

retry.go:37–39  ·  view source on GitHub ↗

LimitRetry limits the number of retries to max attempts.

(s RetryStrategy, max int)

Source from the content-addressed store, hash-verified

35
36// LimitRetry limits the number of retries to max attempts.
37func LimitRetry(s RetryStrategy, max int) RetryStrategy {
38 return &limitedRetry{s: s, max: int64(max)}
39}
40
41func (r *limitedRetry) NextBackoff() time.Duration {
42 if r.cnt.Load() >= r.max {

Calls

no outgoing calls