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
def delete_failed_job_if | |
redis = Resque.redis | |
(0...Resque::Failure.count).each do |i| | |
string = redis.lindex(:failed, i) | |
break if string.nil? | |
job = Resque.decode(string) | |
should_delete_job = yield job | |
next unless should_delete_job |