GraphReFlyTS

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

ParameterTypeDescription
policyRetryPolicyRetry policy to use.
nextAttemptnumberThe 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