Skip to main content

clamp_retry_after_secs

Function clamp_retry_after_secs 

Source
pub fn clamp_retry_after_secs(requested: u64) -> u64
Expand description

Clamps a server-advised Retry-After to MAX_RETRY_AFTER_SECS, warning when the cap actually bites.

Lives beside the constant rather than in either transport because both HTTP retry loops apply the same policy; a second copy of the expression is one edit away from the chat and embedding paths disagreeing about how long a remote limit may stall a one-shot process.

The warning is not decoration: a cap that trims in silence is indistinguishable from a provider that asked for the shorter wait, so the operator would read the retries as normal pacing instead of as a provider demanding a delay this CLI refuses to grant.