Search code examples
ruby-on-railssidekiq

How to clear jobs of only one worker in sidekiq?


I have a worker like this:

class Worker
  include Sidekiq::Worker

  def perform
    # ...
  end
end

But there's something error with this worker, so I want to clear all jobs of it but don't want to clear jobs of other workers.

How can I implement this? Thanks.


Solution

  • Use the API to find and delete the jobs.

    https://github.com/mperham/sidekiq/wiki/API#queue