BullMQ
Search…
⌃K

Removing Jobs

Currently we have 2 available methods in queue class:

Drain

Removes all jobs that are waiting or delayed, but not active, completed or failed.
import { Queue } from 'bullmq';
const queue = new Queue('paint');
await queue.drain();
Parent jobs that belong to the queue being drained will be kept in waiting-children status if they have pending children, but if they do not have any pending children they will just be removed.
Parent jobs in queues different from the one being drained will either stay in waiting-children if they have pending children in other queues, or just moved to wait.

Obliterate

Completely obliterates a queue and all of its contents.
import { Queue } from 'bullmq';
const queue = new Queue('paint');
await queue.obliterate();
Parent jobs in queues different from the one being obliterated will either stay in waiting-children if they have pending children in other queues, or just moved to wait.

Read more: