I have a BullMQ dynamic queue. Is there a way to check how many items there in queue? I already checked in google & stackoverflow and cannot find any solution.
Asked
Active
Viewed 1,030 times
1
-
1https://github.com/taskforcesh/bullmq/blob/master/docs/gitbook/api/bullmq.queuegetters.md There we go they have some documentation on it. – BGPHiJACK Dec 14 '21 at 16:27
1 Answers
0
I suspect there is a better way of doing it, but something like this may work for you:
Queue#getJobs(['waiting', 'active', 'completed', 'failed', 'delayed', 'paused'], 0, 0, false) // meaning asc: false = descending
And check the id for each type of job from the results, sort those descending, and grab the first result.
If you found a better way, please post it.

Ben in CA
- 688
- 8
- 22