Created
March 8, 2023 16:49
-
-
Save renatodex/a5ad496a71d699189af1af8eed0572ba to your computer and use it in GitHub Desktop.
Clean Sidekiq Queues and Remove/Invalidate Batches
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
def clean_sidekiq_and_invalidate_batches | |
Sidekiq::BatchSet.new.each { |batch| Sidekiq::Batch.new(batch.bid).invalidate_all } | |
Sidekiq::Queue.all.each(&:clear) | |
end | |
def clean_sidekiq_and_delete_batches | |
Sidekiq::BatchSet.new.each { |batch| Sidekiq::Batch::Status.new(batch.bid).delete } | |
Sidekiq::Queue.all.each(&:clear) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment