Question about Bull queue : @OnQueueCompleted() listening for one completed job?

889 Views Asked by At

If I use the @OnQueueCompleted(), so I can get the response from one completed job in the queue, am I right? Or the @Onqueuecompleted() only responds when all jobs in the queue are completed.

Please help

1

There are 1 best solutions below

2
Micael Levi On

As the name implies, @OnQueueCompleted() decorator factory refers to the 'completed' event from Bull. Thus, your method will be called every time a job is completed in the queue.

Ref: https://github.com/OptimalBits/bull/blob/edfbd163991c212dd6548875c22f2745f897ae28/test/test_getters.js#L93-L115