How to terminate an active job from producer? #1106
-
I'm trying to work out how to terminate an active job from the producer side.
Line 449 in cf0710c If this is the case, then it seems that is not the intended method to use for this scenario as the producer will not know which worker has picked up the job.
Line 390 in cf0710c
Line 895 in cf0710c The only two working theories I have currently are - If anyone has needed to achieve something similar, it'd be awesome to hear any pointers. edit: Is the correct way to do this via the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @prescience-data, you can get the token from the procesador function as the second parameter https://github.com/taskforcesh/bullmq/blob/master/docs/gitbook/api/bullmq.processor.md. In case You would like to terminate a job to go to failed status, You can throw an error as well |
Beta Was this translation helpful? Give feedback.
-
@manast |
Beta Was this translation helpful? Give feedback.
-
I was able to implement this (for better or worse) by setting an observer on the |
Beta Was this translation helpful? Give feedback.
I was able to implement this (for better or worse) by setting an observer on the
QueueEvents
for the queue on both ends and watching forprogress
events on each job. If either side is reset, the local listener is detached then a "reset object" is sent for the job, which in turn triggers the listener on the opposing side.