Re: [sidekiq] Canceling/Killing A Job
- From:
- Mike Perham
- Date:
- 2012-08-14 @ 03:29
This would be a good use case for the new Job ID feature plus some
custom middleware. Unfortunately there's no real nice way to cleanly
kill a job. I would probably use Thread#raise with a custom exception
and rescue it in the middleware.
On Mon, Aug 13, 2012 at 7:30 PM, Patrick Veverka
<patrick.veverka@threatsim.com> wrote:
> Let's say that a user kicks off a long running background job (in our
> example, we are parsing an uploaded CSV file and comparing to an existing
> database).
>
> They are given indications as to the progress of the job via Javascript in
> their browser. If they decide that they want to stop the job because it
> will take too long, they can click the "cancel" button in the modal.
>
> How would I then stop Sidekiq from processing that single job that it is
> already in the middle of?
>