Skip to content

Instantly share code, notes, and snippets.

@mmaa
Created August 18, 2010 21:55
Show Gist options
  • Select an option

  • Save mmaa/536310 to your computer and use it in GitHub Desktop.

Select an option

Save mmaa/536310 to your computer and use it in GitHub Desktop.
module Resque
...
class Worker
...
def perform(job)
begin
run_hook :after_fork, job
job.perform
rescue Object => e
break if e.is_a?(Resque::DirtyExit) # This is the line I added.
log "#{job.inspect} failed: #{e.inspect}"
job.fail(e)
failed!
else
log "done: #{job.inspect}"
ensure
yield job if block_given?
end
end
...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment