Created
August 18, 2010 21:55
-
-
Save mmaa/536310 to your computer and use it in GitHub Desktop.
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
| 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