-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Killing processes #1950
Comments
@manast wanted to bump this one since as mentioned the docs seem to be incorrect at least for sandboxed processes .on('active', function(job, jobPromise){
// A job has started. You can use `jobPromise.cancel()`` to abort it.
jobPromise.cancel()
}) throws error Also would love to know the recommended way to kill processes. |
@tjhiggins, @LeoRuspini, you can also try this. Works like a charm for me. |
Hey @alolis |
I am afraid I do not have experience with nestjs. However, I have described my whole approach in detail here. It might be helpful to you. |
Description
Hi all,
thanks for this great work.
I been researching the killing of waiting and active jobs (#114, #1098, #812, #1432). I see the need for a killing method and there is several suggested "solutions", however, none of them seems to work properly plus they involved a lot of extra code (connection to ioredis, broadcast, etc). So in same setup as #1432, after discard and moveToFailed in provider, the job is marked as failed but still kept in waiting ( job.isWaiting(): true, job.isFailed(): true). The current example covers how to kill a job from the local server that run the process. However, the jobPromise.cancel() (described in the docs) seems to be removed and I can't find a method to remove from waiting state. If these two methods would be available, then all this can be added as a one line .kill(jobId) method (from the provider), which, from my point of view, is needed by many users.
Minimal, Working Test code to reproduce the issue.
(An easy to reproduce test case will dramatically decrease the resolution time.)
provider.js
worker.js
Bull version
3.20.0
Additional information
Thanks a lot !!!
The text was updated successfully, but these errors were encountered: