MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / exponential_backoff

Function exponential_backoff

crates/opencode-provider/src/retry.rs:132–135  ·  view source on GitHub ↗
(attempt: u32, initial: u64, factor: u64, max: u64)

Source from the content-addressed store, hash-verified

130}
131
132fn 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// ---------------------------------------------------------------------------

Callers 1

delayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected