Created
April 30, 2015 19:41
-
-
Save mattkasa/e679f7ca8cf2e55146d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
jobs = {} | |
Sidekiq::Queue.new('boule').each do |j| | |
if jobs.has_key?("#{j.klass}.#{j.args[0]}(#{j.args[1..-1]})") | |
j.delete and puts "Deleted jid #{j.jid} duplicate of #{jobs["#{j.klass}.#{j.args[0]}(#{j.args[1..-1]})"]}" | |
else | |
jobs["#{j.klass}.#{j.args[0]}(#{j.args[1..-1]})"] = j.jid | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment