bunqueue v2.9 API referenceall versions ยท guide
bunqueue
    Preparing search index...

    Function calculateDelayedErrorDelay

    • Wait applied when a processor throws DelayedError. It is always a positive finite number of milliseconds: DelayedError never counts an attempt, so a zero wait would let a processor that keeps throwing it re-pull the job in a tight loop with nothing to stop it.

      The base is the configured delay with no attempt growth and no jitter: backoff.delay for the object form, otherwise the numeric backoff. A base that is not a positive number (0, missing, negative or NaN) falls back to the 1000 ms default. The base is then capped at backoff.maxDelay when that is a positive finite number, otherwise at DEFAULT_MAX_BACKOFF. A maxDelay of 0 means "retry failures immediately" and does not apply here, because DelayedError is not a failure: such a job waits its capped base delay.

      Parameters

      • job: Pick<Job, "backoff" | "backoffConfig">

      Returns number