Skip to content
PACKAGES

nextRetryDelayMs()

Compute the delay before the next retry.

import { nextRetryDelayMs } from "@graphrefly/ts/graph";
function nextRetryDelayMs(
policy: RetryPolicy,
nextAttempt: number,
): number | undefined
ParameterTypeDescription
policyRetryPolicyRetry policy to use.
nextAttemptnumberThe attempt number about to run.

The delay in milliseconds, or undefined when the attempt is out of range.

nextRetryDelayMs(retryPolicy(3, { kind: "constant", delayMs: 250 }), 2);

packages/ts/src/graph/resilience.ts