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