[Question] Proper way to clear entire queue?
Created by: yaboi
Description
Just curious if this is the most efficient way to clear an entire single queue of all jobs regardless of state.
It doesn't seem like .empty()
or removeJobs('*')
gets all jobs through my testing, but when using both it seems to consistently clear a queue. Is there a better, more sure-fire way to doing this?
Note, looping over each state and calling clean(0, state)
didn't seem to clear all jobs either.
Minimal, Working Test code to reproduce the issue.
// No need to `.then()` an `await`
// await queue.pause(true).then(async () => {
// await queue.empty()
// await queue.removeJobs('*')
// await queue.resume(true)
// })
await userQueue.pause(true)
await userQueue.empty()
await userQueue.removeJobs('*')
return await userQueue.resume(true)
Bull version
v3.16.0
Additional information
None