Skip to content

Instantly share code, notes, and snippets.

@x0bandeira
Created November 21, 2013 17:29
Show Gist options
  • Save x0bandeira/7585945 to your computer and use it in GitHub Desktop.
Save x0bandeira/7585945 to your computer and use it in GitHub Desktop.
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