Function: retry()
retry<
T>(fn,options?):Promise<T>
Re-runs an async operation until it succeeds or the retry budget is exhausted. Synchronous functions work too — the call is wrapped in a promise internally.
Only failures that pass shouldRetry are retried; the final failure
rethrows the last error thrown by the operation.
Type Parameters
T
T
Parameters
fn
() => T | Promise<T>
The operation to run. May be sync or return a promise.
options?
Retry behaviour — see RetryOptions.
Returns
Promise<T>
A Promise resolving with the operation's value.
