Last active
May 5, 2020 12:26
-
-
Save sharmaparesh/ec6d24512145bc81e3bce886ed1222b4 to your computer and use it in GitHub Desktop.
Sidekiq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sidekiq/api' | |
# Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear | |
# Clear 'Dead' jobs statistics | |
Sidekiq::DeadSet.new.clear | |
# Clear 'Processed' and 'Failed' jobs statistics | |
Sidekiq::Stats.new.reset | |
# Clear specific queue | |
stats = Sidekiq::Stats.new | |
stats.queues | |
# => {"main_queue"=>25, "my_custom_queue"=>1} | |
queue = Sidekiq::Queue.new('my_custom_queue') | |
queue.count | |
queue.clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment