bunqueue v2.9 API referenceall versions · guide
bunqueue
    Preparing search index...

    Interface RetryConfig

    Advanced retry configuration. Every computed delay is honoured exactly, even one beyond the runtime's 2^31 - 1 ms timer limit; growth has no cap and saturates at Number.MAX_SAFE_INTEGER ms instead of overflowing.

    interface RetryConfig {
        customBackoff?: (attempt: number, error: Error) => number;
        delay?: number;
        maxAttempts?: number;
        retryIf?: (error: Error, attempt: number) => boolean;
        strategy?: RetryStrategy;
    }
    Index
    customBackoff?: (attempt: number, error: Error) => number

    Custom backoff function: attempt → delay in ms. It must return a finite number

    = 0; any other result fails the job with a TypeError or RangeError whose cause is the processor error, instead of retrying.

    delay?: number

    Base delay in ms (default: 1000): a finite number >= 0

    maxAttempts?: number

    Max attempts, the first one included (default: 3): a whole number >= 1, or Infinity to retry until success, cancel() or close().

    retryIf?: (error: Error, attempt: number) => boolean

    Only retry if this returns true

    strategy?: RetryStrategy

    Strategy (default: exponential)