Created
August 23, 2012 14:21
-
-
Save unixcharles/3437099 to your computer and use it in GitHub Desktop.
Clean up redis queue
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_name = 'queue:queue_name' | |
len = Resque.redis.llen(queue_name) | |
deletion = Resque.redis.lrange(queue_name,0, len).select do |entry| | |
JSON.parse(entry)['args'][0] == "some_criterial" rescue nil | |
end | |
deletion.each do |entry| | |
puts entry | |
puts Resque.redis.lrem queue_name, -1, entry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment