Skip to content

retryWithBackoff

retryWithBackoff<T>(fn, options, attempt?): Promise<T>

Defined in: packages/simply-core/src/async/retryWithBackoff.ts:81

Calls fn, retrying on failure up to options.retryAttempts additional times with an exponentially growing delay between attempts, before rethrowing the last error.

T

() => Promise<T>

The operation to attempt.

RetryWithBackoffOptions

Retry attempt count, backoff configuration, and optional retry hooks.

number = 0

The current attempt number, 0-indexed. Used internally for recursion.

Promise<T>

The result of fn once it succeeds.