Skip to main content

backoff

Function backoff 

Source
pub fn backoff(retry_after: Duration, attempts: u32, cap: Duration) -> Duration
Expand description

How long to wait before the next attempt.

Exponential: the job’s own retry_after, doubled once per attempt already made, capped. A dependency that is down stays down for a while, and hammering it every minute helps nobody.