Usage
Interface
Options
priority
Optional priority value. Ranges from 1 (highest priority) to MAX_INT (lowest priority).
Using priorities has a slight performance impact. Only use if required.
delay
Amount of milliseconds to wait before this job can be processed.
For accurate delays, both server and clients should have synchronized clocks.
attempts
Total number of attempts to try the job until it completes.Use with
backoff to configure retry delays.backoff
Backoff settings for automatic retries if the job fails. Requires Fixed backoff:Exponential backoff:Custom backoff:
attempts to be set.repeat
Repeat job according to a cron specification or interval.Cron-based repeating:Interval-based repeating:With limits:See cron-parser for cron expression syntax.
Jobs are scheduled “on the hour”. A job with
cron: '*/15 * * * *' created at 4:07 will first run at 4:15, then 4:30, etc.lifo
If true, adds the job to the right of the queue instead of the left (Last In First Out).
timeout
Number of milliseconds after which the job should fail with a timeout error.Handling timeouts in processor:
jobId
Override the job ID. By default, the job ID is a unique integer.Repeatable jobs and jobId:
Repeatable jobs with the same
jobId but different repeat configurations are considered different:removeOnComplete
Control job retention after successful completion.
true- Remove immediately after completionfalse- Keep in completed set (default)number- Keep only the last N completed jobsKeepJobs- Keep based on age and/or count
This helps prevent Redis from running out of memory in high-volume queues.
removeOnFail
Control job retention after failure (after all attempts exhausted).
true- Remove immediately after final failurefalse- Keep in failed set (default)number- Keep only the last N failed jobsKeepJobs- Keep based on age and/or count
stackTraceLimit
Limit the number of stack trace lines recorded when a job fails.
KeepJobs Interface
age and count are specified, jobs are kept if they satisfy both properties.