Skip to content
PACKAGES

shouldRetry()

Check whether another retry attempt remains.

import { shouldRetry } from "@graphrefly/ts/graph";
function shouldRetry(
policy: RetryPolicy,
failedAttempt: number,
): boolean
ParameterTypeDescription
policyRetryPolicyRetry policy to inspect.
failedAttemptnumberThe attempt number that just failed.

true while the failed attempt is still below the maximum.

shouldRetry(retryPolicy(3), 2); // true

packages/ts/src/graph/resilience.ts