Skip to main content

execute_with_retry

Function execute_with_retry 

Source
pub async fn execute_with_retry<F, Fut, T>(
    max_retries: u32,
    base_backoff: Duration,
    operation: F,
) -> Result<T, FaucetError>
where F: FnMut() -> Fut, Fut: Future<Output = Result<T, FaucetError>>,
Expand description

Execute operation with up to max_retries retries on retriable errors, using exponential backoff (base_backoff * 2^attempt) with random jitter. Non-retriable errors return immediately; Ok returns immediately.