Sidekiq stop one single, running job

Figedi picture Figedi · Sep 17, 2014 · Viewed 18.8k times · Source

So I need to stop a running Job in Sidekiq (3.1.2) programmatically, not a scheduled one. I did read the API documentation but didn't really find anything about cancelling running jobs. Is this possible with sidekiq?

When this is not directly possible, my idea was to circumvent this, by raising an exception in the job when I call the signal, then deleting the job from the retryset. This is clearly not optimal though.

Thanks in advance

Answer

Mike Perham picture Mike Perham · Sep 17, 2014

Correct, the only way to stop a job is for the job to stop itself. Your application must implement that logic.

https://github.com/mperham/sidekiq/wiki/FAQ#how-do-i-cancel-a-sidekiq-job