Last active
September 19, 2017 16:31
-
-
Save joannou/ea0453f99c0d8dc011ec19d999744905 to your computer and use it in GitHub Desktop.
To Retry Resque Jobs of a Certain Class or Exception
This file contains hidden or 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
Resque::Failure.all(0, Resque::Failure.count).each_with_index do |failure, i| | |
job_string = failure['payload']['args'][0]['job_class'] | |
exception_string = failure['exception'] | |
p "#{i} #{job_string} #{exception_string}" | |
if exception_string == 'AWS::S3::SlowDown' | |
p "Retrying job #{i}" | |
Resque::Failure.requeue i | |
end | |
end; nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment