Last active
October 11, 2015 16:56
-
-
Save hirobo/a7044d9c744f7a42ccec 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
# do only retry if not yet retried | |
def retry_failure | |
(Resque::Failure.count-1).downto(0).each do |i| | |
job = Resque::Failure.all(i, 1) | |
puts job['queue'] | |
puts job['failed_at'] | |
puts "retried_at: #{job['retried_at'].present?}" | |
puts job['error'][0..512] | |
if !job['retried_at'].present? | |
puts "requeue: #{i}" | |
Resque::Failure.requeue(i) | |
Resque::Failure.remove(i) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment