BullMQ
Search…
What is BullMQ
Quick Start
API Reference
Changelog
Guide
Introduction
Connections
Queues
Workers
Jobs
FIFO
LIFO
Job Ids
Delayed
Repeatable
Prioritized
Removing job
Stalled
Getters
Flows
Metrics
Rate limiting
Retrying failing jobs
Returning job data
Events
QueueScheduler
Architecture
Patterns
Manually processing jobs
Producer - Consumer
Named Processor
Flows
Real time updates
Sender - Receiver
Working with batches
Idempotent jobs
Throttle jobs
Process Step Jobs
Failing fast when Redis is down
BullMQ Pro
Introduction
Install
Observables
Groups
API Reference
Changelog
Bull
Introduction
Install
Quick Guide
Important Notes
Reference
Patterns
Bull 3.x Migration
Compatibility class
Migration
Powered By
GitBook
Removing job
Removing job
Sometimes it is necessary to remove a job. For example, there could be a job that has bad data.
1
import
{
Queue
}
from
'bullmq'
;
2
​
3
const
queue
=
new
Queue
(
'paint'
);
4
​
5
const
job
=
await
queue
.
add
(
'wall'
,
{
color
:
1
});
6
​
7
await
job
.
remove
();
Copied!
Locked jobs (in active state) can not be removed. An error will be thrown.
Having a parent job
There are 2 possible cases:
1.
There are not pending dependencies; in this case the parent is moved to wait status, we may try to process this job.
2.
There are pending dependencies; in this case the parent is kept in waiting-children status.
Having pending dependencies
We may try to remove all its pending descendents first.
In case one of the children is locked, it will stop the deletion process.
Previous
Prioritized
Next
Stalled
Last modified
4mo ago
Copy link
Contents
Removing job
Having a parent job
Having pending dependencies