shouldRetry()
Check whether another retry attempt remains.
Import
Section titled “Import”import { shouldRetry } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function shouldRetry( policy: RetryPolicy, failedAttempt: number,): booleanParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
policy | RetryPolicy | Retry policy to inspect. |
failedAttempt | number | The attempt number that just failed. |
Returns
Section titled “Returns”true while the failed attempt is still below the maximum.
Example
Section titled “Example”shouldRetry(retryPolicy(3), 2); // trueSource
Section titled “Source”packages/ts/src/graph/resilience.ts