Skip to content

Instantly share code, notes, and snippets.

@lulalala
Created August 16, 2012 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lulalala/3368331 to your computer and use it in GitHub Desktop.
Save lulalala/3368331 to your computer and use it in GitHub Desktop.
Remove duplicate ender
set = Set.new()
i = 0
Delayed::Job.order('id DESC').where('queue = "ender"').find_each do |d|
if not (set.add?( d.handler[/\d+/].to_i ))
d.destroy
i += 1
end
end
puts i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment