How to clear Sidekiq retries queue?
Hey guys!
Today I bring a quick post/note/reminder (especially to myself) about how to clear the Sidekiq retries queue.
Sidekiq the background processing gem for ruby works extremely well in almost any condition, it is fast and reliable.
But sometimes, a worker can crash, and depending on your retries configuration it can be annoying.
If you are working on your development box and want to clear that retries queue you can follow these steps:
1. Go to your CLI and access the rails console
bundle exec rails c
2. Make sure to require Sidekiq
require ‘sidekiq/api’
3. Clear the queue
Sidekiq::RetrySet.new.clear
4. Optional You can check the size of the queue by using the size method:
Sidekiq::RetrySet.new.size
You can always check the full Sidekiq documentation
You are all set, I hope it helps!