Search code examples
ruby-on-railsrubysidekiq

How to clear all the jobs from Sidekiq?


I am using sidekiq for background tasks in Rails application. Now the numbers of jobs becomes more, so I want to clear all the jobs. I tried the following command in console

Sidekiq::Queue.new.clear

but it was giving following error.

NameError: uninitialized constant Sidekiq::Queue 

How do I clear all the jobs from sidekiq?


Solution

  • According to this issue on Github: https://github.com/mperham/sidekiq/issues/1732 you now need to

    require 'sidekiq/api'