Optional
opts: QueueProOptionsReadonly
nameAdds a Job to the queue.
Optional
opts: JobsProOptionsAdds an array of jobs to the queue.
The array of jobs to add to the queue. Each job is defined by 3 properties, 'name', 'data' and 'opts'. They follow the same signature as 'Queue.add'.
Cleans jobs from a queue. Similar to drain but keeps jobs within a certain grace period.
The grace period
Max number of jobs to clean
Optional
type: "active" | "completed" | "delayed" | "failed" | "paused" | "wait"Default completed - The type of job to clean Possible values are completed, wait, active, paused, delayed, failed. Defaults to completed.
Id jobs from the deleted records
Job counts by type
Queue#getJobCountByTypes('completed') => completed count Queue#getJobCountByTypes('completed,failed') => completed + failed count Queue#getJobCountByTypes('completed', 'failed') => completed + failed count Queue#getJobCountByTypes('completed', 'waiting', 'failed') => completed + waiting + failed count
Rest
...types: JobType[]Returns the job counts for each type specified or every list/set in the queue by default.
Rest
...types: JobType[]An object, key (type) and value (count)
Get queue metrics related to the queue.
This method returns the gathered metrics for the queue. The metrics are represented as an array of job counts per unit of time (1 minute).
Optional
start: numberStart point of the metrics, where 0 is the newest point to be returned.
Optional
end: numberEnd point of the metrics, where -1 is the oldest point to be returned.
Optional
start: numberOptional
end: numberOptional
asc: booleanGet all repeatable meta jobs.
Optional
start: numberOffset of first job to return.
Optional
end: numberOffset of last job to return.
Optional
asc: booleanDetermine the order in which jobs are returned based on their next execution time.
Pauses the processing of this queue globally.
We use an atomic RENAME operation on the wait queue. Since we have blocking calls with BRPOPLPUSH on the wait queue, as long as the queue is renamed to 'paused', no new jobs will be processed (the current ones will run until finalized).
Adding jobs requires a LUA script to check first if the paused list exist and in that case it will add it there instead of the wait list.
Retry all the failed jobs.
Optional
opts: { contains number to limit how many jobs will be moved to wait status per iteration, state (failed, completed) failed by default or from which timestamp.
Optional
count?: numberOptional
state?: FinishedStatusOptional
timestamp?: numberGenerated using TypeDoc
Returns this instance current default job options.