Skip to main content

decideRetry

@retinue/monorepo


@retinue/monorepo / backend/src / decideRetry

Function: decideRetry()

decideRetry(input): RetryDecision

Defined in: backend/src/runtime/retry.ts:97

Decide whether the failed attempt should be retried and, if so, how long to wait. random defaults to Math.random; inject a fixed value for deterministic tests. When the error carries retryAfterMs, the wait is at least that long (capped by retryAfterCapMs) — honoring the server without letting it stall the run indefinitely.

Parameters​

input​

attempt​

number

error​

PlatformError

policy​

RetryPolicy

random?​

() => number

Returns​

RetryDecision