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
| Parameter | Type | Description |
|---|---|---|
policy | RetryPolicy | Retry policy to inspect. |
failedAttempt | number | The 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