Duration returns the duration of the requested backoff and resets all others.
(key interface{})
| 21 | |
| 22 | // Duration returns the duration of the requested backoff and resets all others. |
| 23 | func (all combinedExponentialBackoff) Duration(key interface{}) (dur time.Duration) { |
| 24 | for k, backoff := range all { |
| 25 | if k == key { |
| 26 | dur = backoff.Duration() |
| 27 | } else { |
| 28 | backoff.Reset() |
| 29 | } |
| 30 | } |
| 31 | return |
| 32 | } |