Last active
August 29, 2015 14:17
-
-
Save SkylerRogers/933a6007a24ae43ce479 to your computer and use it in GitHub Desktop.
Clean Out Old Resque Failures by Date
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
Resque::Failure.each do |f| | |
if Resque::Failure.all(f)["failed_at"].to_datetime.year < 2015 | |
Resque::Failure.remove(f) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Delete by year and month
Resque::Failure.each do |f|
failure_dt = Resque::Failure.all(f)["failed_at"].to_datetime
if failure_dt.year == 2015 && failure_dt.month <= 2
Resque::Failure.remove(f)
end
end