Skip to main content

retry_with_backoff

Function retry_with_backoff 

Source
pub async fn retry_with_backoff<F, Fut, T>(
    op: F,
    max_retries: usize,
    initial_delay: Duration,
    context: &str,
) -> Result<T>
where F: FnMut() -> Fut, Fut: Future<Output = Result<T>>,
👎Deprecated:

use vtcode_commons::retry::RetryPolicy (or http::send_with_retry for HTTP)

Expand description

Retry an operation with exponential backoff.

Kept for source compatibility with the published crate. New code should use crate::retry::RetryPolicy, which classifies errors and applies bounded, jittered delays; this helper retries every error unconditionally.