Function
exponential_backoff
(attempt: u32, initial: u64, factor: u64, max: u64)
Source from the content-addressed store, hash-verified
| 130 | } |
| 131 | |
| 132 | fn exponential_backoff(attempt: u32, initial: u64, factor: u64, max: u64) -> u64 { |
| 133 | let exp = factor.saturating_pow(attempt.saturating_sub(1)); |
| 134 | initial.saturating_mul(exp).min(max) |
| 135 | } |
| 136 | // --------------------------------------------------------------------------- |
| 137 | // with_retry – generic retry wrapper |
| 138 | // --------------------------------------------------------------------------- |
Tested by
no test coverage detected