Function calculate_retry_delay

Source
pub fn calculate_retry_delay(
    attempt: u8,
    base_delay_ms: u64,
    max_delay_ms: u64,
) -> Duration
Expand description

Calculate the retry delay using exponential backoff with jitter

§Arguments

  • attempt - The retry attempt number (0 = first attempt)
  • base_delay_ms - Base delay in milliseconds
  • max_delay_ms - Maximum delay in milliseconds

§Returns

Duration to wait before the next retry