GraphReFlyTS

API Reference

shouldRetry()

Check whether another retry attempt remains.

Import

import { shouldRetry } from "@graphrefly/ts/graph";

Signature

function shouldRetry(
	policy: RetryPolicy,
	failedAttempt: number,
): boolean

Parameters

ParameterTypeDescription
policyRetryPolicyRetry policy to inspect.
failedAttemptnumberThe attempt number that just failed.

Returns

true while the failed attempt is still below the maximum.

Example

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

Source

packages/ts/src/graph/resilience.ts