An exponential backoff retry mechanism

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

jobs: {
    [id: string]: InternalJobData;
} = {}

A map of job ids to data about the job

Type declaration

config: {
    initialWaitMs: number;
    maxRetryMs: number;
}

Type declaration

  • initialWaitMs: number

    The initial delay, which will be doubled on every subsequent retry

  • maxRetryMs: number

    The max number of ms to retry before giving up and throwing a RetryTimeoutError. Note that this is an absolute value which includes time spent actually running the job. For example, if you set this to 1 hour and your job takes 30 minutes to run, you will only get 2 retries.

Methods

  • Run a job, retrying on failure according to the logic of the concrete class used.

    Parameters

    • job: (() => Promise<boolean>)
        • (): Promise<boolean>
        • Returns Promise<boolean>

    • log: SimpleLoggerInterface
    • Optional _jobId: string

    Returns Promise<boolean>

Generated using TypeDoc