API Core - v1.5.0
    Preparing search index...

    Function withRetryBackoff

    • Run operation, retrying on errors accepted by options.isRetryable.

      Uses exponential backoff with bounded jitter between attempts. Stops and rethrows once maxRetries is exhausted or the error is judged non-retryable. If options.signal aborts during a backoff sleep, the loop exits with the signal's reason instead of waiting out the delay.

      Type Parameters

      • T

      Parameters

      • operation: () => Promise<T>

        The async function to attempt; will be invoked up to maxRetries + 1 times.

      • options: RetryBackoffOptions

        Backoff parameters and retry predicate.

      Returns Promise<T>

      The operation's resolved value on first success.