Search code examples
ruby-on-railsruby-on-rails-4ruby-on-rails-5scheduled-taskssidekiq

Delete all scheduled task in Sidekiq


I am working with rails and have the bunch of schedule tasks running on sidekiq, and anyway I want to delete all of that tasks from schedule list. I was wonder whether is there any command with rails I can run to clear all those stuff ?


Solution

  • There is. Given that your queue is called "my_queue":

    require 'sidekiq/api'
    Sidekiq::ScheduledSet.new("my_queue").clear
    

    Check out Sidekiq API.