Skip to content

Instantly share code, notes, and snippets.

@mehdi-farsi
Last active December 31, 2015 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehdi-farsi/8004792 to your computer and use it in GitHub Desktop.
Save mehdi-farsi/8004792 to your computer and use it in GitHub Desktop.
Display the 20 last Resque failed jobs in console.
start_at = Resque::Failure.count - 20
finish_at = Resque::Failure.count
Resque::Failure.all(start_at, finish_at).each do |job|
puts "----------"
puts "#{job["failed_at"]}"
puts "#{job["payload"]}"
puts "#{job["error"]}"
job["backtrace"].each do |line|
puts "#{line}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment