Reputation: 145
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 ?
Upvotes: 6
Views: 7487
Reputation: 349
Neither of the listed solutions worked for me so I had to shut down redis-server and sidekiq and delete the dump.rdb file. Keep in mind, doing this will delete all queues, all the retries, and the lists of processed, failed and dead jobs.
Upvotes: 0
Reputation: 52357
There is. Given that your queue is called "my_queue"
:
require 'sidekiq/api'
Sidekiq::ScheduledSet.new("my_queue").clear
Check out Sidekiq API.
Upvotes: 14
Reputation: 5330
The accepted answer didn't work for me. What I did to clear the queue was:
Sidekiq::ScheduledSet.new.clear
If you need clearing the scheduled queue, you might need also clearing other queues:
Sidekiq::RetrySet.new.clear
Sidekiq::Queue.new("your_queue_name").clear
Sidekiq::Queue.all.each(&:clear)
Upvotes: 12