Created
November 21, 2013 17:29
-
-
Save x0bandeira/7585945 to your computer and use it in GitHub Desktop.
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
entries.each do |e| | |
begin | |
do_stuff(e) | |
rescue => error | |
$redis.lpush("failed_strip", e.id) # will create the list and/or append the value | |
end | |
# counting | |
puts "failed: " + $redis.llen("failed_strip") | |
# using | |
ids = $redis.lrange("failed_strip", 0, -1) | |
Foo.where(id: ids).each do |e| | |
retry_do_stuff(e) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment