Skip to main content

backoff_for

Function backoff_for 

Source
pub fn backoff_for(consecutive_errors: u32) -> Duration
Expand description

Compute the backoff for the nth consecutive failure (1-based), clamped to [BACKOFF_MAX]. Exponential in the error count so transient blips retry soon while a durably-broken feed backs off toward daily.

The scheduler passes the feed’s persisted consecutive_errors count (see crate::store::bump_feed_errors) so a feed that keeps failing actually climbs toward [BACKOFF_MAX] instead of retrying at the floor forever.