effectiveDelay returns the delay for the given 0-indexed attempt while honoring any provider-supplied minimum retry delay.
(attempt int, classified ClassifiedError)
| 53 | // effectiveDelay returns the delay for the given 0-indexed attempt |
| 54 | // while honoring any provider-supplied minimum retry delay. |
| 55 | func effectiveDelay(attempt int, classified ClassifiedError) time.Duration { |
| 56 | delay := Delay(attempt) |
| 57 | if classified.RetryAfter > delay { |
| 58 | return classified.RetryAfter |
| 59 | } |
| 60 | return delay |
| 61 | } |
| 62 | |
| 63 | // RetryFn is the function to retry. It receives a context and returns |
| 64 | // an error. The context may be a child of the original with adjusted |