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