Created
July 1, 2015 21:54
-
-
Save danielevans/99b40f30491d6412b4de to your computer and use it in GitHub Desktop.
Delete ActiveJob jobs from resque failure which are not of a specific job class
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
failures = Resque::Failure.count | |
failures.times do |i| | |
print "#{i}." | |
failure_id = failures - 1 - i | |
begin | |
Resque::Failure.remove(failure_id) if Resque::Failure.all(failure_id)["payload"]["args"].first["job_class"] == "SyncOrders" | |
rescue JSON::ParserError | |
Resque::Failure.remove(failure_id) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment