Skip to content

Instantly share code, notes, and snippets.

@mattkasa
Created April 30, 2015 19:41
Show Gist options
  • Save mattkasa/e679f7ca8cf2e55146d4 to your computer and use it in GitHub Desktop.
Save mattkasa/e679f7ca8cf2e55146d4 to your computer and use it in GitHub Desktop.
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