JobsModuleOptions
Options of JobsModule.forRoot.
Properties
Section titled “Properties”context?
Section titled “context?”
readonlyoptionalcontext?:JobContextHook
Carries the app’s request context (ids, tenant) from producer to worker.
prefix?
Section titled “prefix?”
readonlyoptionalprefix?:string
BullMQ’s key prefix. Defaults to BullMQ’s own (bull).
producer?
Section titled “producer?”
readonlyoptionalproducer?:object
commandTimeoutMs?
Section titled “commandTimeoutMs?”
readonlyoptionalcommandTimeoutMs?: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.
redisUrl
Section titled “redisUrl”
readonlyredisUrl:string
The full Redis URL: redis://user:password@host:port/db, or rediss://
for TLS. Every connection is built from all of it.
shutdown?
Section titled “shutdown?”
readonlyoptionalshutdown?:object
drainTimeoutMs?
Section titled “drainTimeoutMs?”
readonlyoptionaldrainTimeoutMs?: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.
sweeps?
Section titled “sweeps?”
readonlyoptionalsweeps?:object
concurrency?
Section titled “concurrency?”
readonlyoptionalconcurrency?:number
Sweeps one process runs at once. Defaults to 1.
onError?
Section titled “onError?”
readonlyoptionalonError?: (sweep,error) =>void|Promise<void>
Called after a sweep fails (after the metric and the error report).
Parameters
Section titled “Parameters”string
unknown
Returns
Section titled “Returns”void | Promise<void>
queue?
Section titled “queue?”
readonlyoptionalqueue?:string
The queue that carries sweep ticks. Defaults to jobs-sweeps; one per app.
reconcile?
Section titled “reconcile?”
readonlyoptionalreconcile?:boolean
Remove schedulers no sweep declares at boot. Defaults to true.
telemetry?
Section titled “telemetry?”
readonlyoptionaltelemetry?:JobsTelemetry
workers?
Section titled “workers?”
readonlyoptionalworkers?:boolean
Run workers and the sweep worker in this process. Defaults to true. Set it false on replicas that only enqueue.