Created
July 17, 2018 11:50
-
-
Save MarceloCajueiro/64bdc429c579a34abb64f4cdc82f4b30 to your computer and use it in GitHub Desktop.
Move sidekiq jobs from one queue to another
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
queue = Sidekiq::Queue.new("default") | |
queue.each do |job| | |
if job.klass == "DailyFrequencyCreatorWorker" | |
DailyFrequencyCreatorWorker.set(queue: 'daily_frequency_creator').perform_async(*job.args) | |
job.delete | |
end | |
end;nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was very helpful, I did an improvement for my use case and would like to share here