Skip to content

Instantly share code, notes, and snippets.

@joannou
Last active September 19, 2017 16:31
Show Gist options
  • Save joannou/ea0453f99c0d8dc011ec19d999744905 to your computer and use it in GitHub Desktop.
Save joannou/ea0453f99c0d8dc011ec19d999744905 to your computer and use it in GitHub Desktop.
To Retry Resque Jobs of a Certain Class or Exception
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