Options controlling the number of retries attempted after a job fails and selecting which errors are retried. If backoffMs or retries are set then jobs are retried. Else failures are immediately passed back to the caller. See also BackoffOptions.

interface RetryOptions {
    retries: number;
    retryAllowed?: ((error) => boolean);
}

Properties

retries: number

The number of attempts before considering a Job to be rejected.

retryAllowed?: ((error) => boolean)

Predicate to determine if a thrown error allows a retry. If retries or backoffMs is set, but retryAllowed is omitted then jobs are retried after all errors.

Type declaration

    • (error): boolean
    • Parameters

      • error: unknown

      Returns boolean