Skip to main content

with_retry

Function with_retry 

Source
pub async fn with_retry<T, F, Fut>(
    name: &str,
    operation: F,
) -> Result<T, StorageError>
where F: Fn() -> Fut, Fut: Future<Output = Result<T, StorageError>>,
Expand description

Runs operation until it succeeds or fails with a non-transient error, backing off exponentially for at most four tries. Backends wrap each request in this; name only labels the retry log line.

ยงErrors

Returns the last error from operation once it is not transient or the tries are used up.