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 ?
Sidekiq reads jobs from a Redis queue, using the First In First Out (FIFO) model, to process jobs.
Sidekiq gem is used to move long running jobs to background for asynchronous processing. It is more efficient, with respect to memory usage, than delayed_job and Resque as it uses threads instead of forks.
There is. Given that your queue is called "my_queue"
:
require 'sidekiq/api'
Sidekiq::ScheduledSet.new("my_queue").clear
Check out Sidekiq API.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With