Skip to content

JobsModuleOptions

Options of JobsModule.forRoot.

readonly optional context?: JobContextHook

Carries the app’s request context (ids, tenant) from producer to worker.


readonly optional prefix?: string

BullMQ’s key prefix. Defaults to BullMQ’s own (bull).


readonly optional producer?: object

readonly optional commandTimeoutMs?: number

Bound on one Redis command and on one whole add(), in milliseconds. Defaults to 3000. While an outage is known, add() refuses at once.


readonly redisUrl: string

The full Redis URL: redis://user:password@host:port/db, or rediss:// for TLS. Every connection is built from all of it.


readonly optional shutdown?: object

readonly optional drainTimeoutMs?: number

How long draining waits for running jobs. Defaults to 20000 ms, which leaves room for the rest of the shutdown inside the 25 s deadline of installGracefulShutdown and a 30 s container stop grace period.


readonly optional sweeps?: object

readonly optional concurrency?: number

Sweeps one process runs at once. Defaults to 1.

readonly optional onError?: (sweep, error) => void | Promise<void>

Called after a sweep fails (after the metric and the error report).

string

unknown

void | Promise<void>

readonly optional queue?: string

The queue that carries sweep ticks. Defaults to jobs-sweeps; one per app.

readonly optional reconcile?: boolean

Remove schedulers no sweep declares at boot. Defaults to true.


readonly optional telemetry?: JobsTelemetry


readonly optional workers?: boolean

Run workers and the sweep worker in this process. Defaults to true. Set it false on replicas that only enqueue.