Skip to content

Instantly share code, notes, and snippets.

@calvincorreli
Created November 24, 2010 11:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvincorreli/713491 to your computer and use it in GitHub Desktop.
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/
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