RetryOptions
Defined in: core/src/retry.ts:24
Properties
Section titled “Properties”baseDelayMs?
Section titled “baseDelayMs?”optional baseDelayMs?: number;Defined in: core/src/retry.ts:27
budgetMs?
Section titled “budgetMs?”optional budgetMs?: number;Defined in: core/src/retry.ts:41
How long recovery may go on, counted from the FIRST failure. A retry
starts only if it would start before then, its wait included. An attempt
already running is never cut. Default 60s; Infinity turns it off.
Without it the worst case is every attempt in full plus every wait: three stalled streams at the watchdog’s 300s each is a quarter of an hour before the caller hears anything. The clock starts at the first failure, not at the call, so a long healthy run that then fails still gets its recovery.
maxAttempts?
Section titled “maxAttempts?”optional maxAttempts?: number;Defined in: core/src/retry.ts:26
Total attempts including the first. Default 3.
maxDelayMs?
Section titled “maxDelayMs?”optional maxDelayMs?: number;Defined in: core/src/retry.ts:30
Maximum acceptable wait. A longer server deadline ends retry so an outer fallback can switch provider; it is never shortened to retry too early.
onRetry?
Section titled “onRetry?”optional onRetry?: (info) => void;Defined in: core/src/retry.ts:46
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
{ attempt: number; delayMs: number; error: unknown; } |
info.attempt |
number |
info.delayMs |
number |
info.error |
unknown |
Returns
Section titled “Returns”void
shouldRetry?
Section titled “shouldRetry?”optional shouldRetry?: (err, attempt) => boolean;Defined in: core/src/retry.ts:45
Decide retryability. Default: transient kinds only.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
err |
unknown |
attempt |
number |
Returns
Section titled “Returns”boolean
signal?
Section titled “signal?”optional signal?: AbortSignal;Defined in: core/src/retry.ts:43
Aborts the wait as well as the work, so Stop lands promptly.
sleep?
Section titled “sleep?”optional sleep?: (ms, signal?) => Promise<void>;Defined in: core/src/retry.ts:48
Injected in tests so a suite never really waits.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ms |
number |
signal? |
AbortSignal |
Returns
Section titled “Returns”Promise<void>