API Reference
nextRetryDelayMs()
Compute the delay before the next retry.
Import
import { nextRetryDelayMs } from "@graphrefly/ts/graph";
Signature
function nextRetryDelayMs(
policy: RetryPolicy,
nextAttempt: number,
): number | undefined
Parameters
| Parameter | Type | Description |
|---|---|---|
policy | RetryPolicy | Retry policy to use. |
nextAttempt | number | The attempt number about to run. |
Returns
The delay in milliseconds, or undefined when the attempt is out of range.
Example
nextRetryDelayMs(retryPolicy(3, { kind: "constant", delayMs: 250 }), 2);
Source
packages/ts/src/graph/resilience.ts