Skip to main content

retry_request

Function retry_request 

Source
pub async fn retry_request<F, Fut, T>(
    max_retries: usize,
    f: F,
) -> Result<T, LangfuseError>
where F: Fn() -> Fut, Fut: Future<Output = Result<T, LangfuseError>>,
Expand description

Execute an async operation with exponential backoff retry.

Retries on:

  • 5xx server errors
  • 429 Too Many Requests
  • Network errors

Does NOT retry on:

  • 4xx client errors (except 429)
  • Auth errors