Created
November 24, 2010 11:02
-
-
Save calvincorreli/713491 to your computer and use it in GitHub Desktop.
Integrating Exceptional with https://github.com/collectiveidea/delayed_job - put this in config/initializers/
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
if !Exceptional::Config.api_key.nil? && Rails.env == 'production' | |
begin | |
class Delayed::Worker | |
def handle_failed_job_with_exceptional(job, error) | |
Exceptional.handle(error, "Delayed::Job #{self.name}") | |
handle_failed_job_without_exceptional(job, error) | |
Exceptional.context.clear! | |
end | |
alias_method_chain :handle_failed_job, :exceptional | |
Exceptional.logger.info "Lars Pind's custom DJ integration enabled" | |
end | |
rescue => e | |
STDERR.puts "Problem starting Exceptional for Delayed-Job. Your app will run as normal." | |
Exceptional.logger.error(e.message) | |
Exceptional.logger.error(e.backtrace) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment