module Honeybadger::Plugins::Resque::Extension
Public Instance Methods
Source
# File lib/honeybadger/plugins/resque.rb, line 14 def after_perform_with_honeybadger(*args) Honeybadger.clear! end
Source
# File lib/honeybadger/plugins/resque.rb, line 10 def around_perform_with_honeybadger(*args) Honeybadger.flush { yield } end
Executed before on_failure
hook; the flush is necessary so that errors reported within jobs get sent before the worker dies.
Source
# File lib/honeybadger/plugins/resque.rb, line 20 def on_failure_with_honeybadger(e, *args) Honeybadger.notify(e, parameters: { job_arguments: args }, sync: true) if send_exception_to_honeybadger?(e, args) ensure Honeybadger.clear! end
Error notifications must be synchronous as the on_failure
hook is executed after around_perform
.
Source
# File lib/honeybadger/plugins/resque.rb, line 26 def send_exception_to_honeybadger?(e, args) return true unless respond_to?(:retry_criteria_valid?) return true if ::Honeybadger.config[:'resque.resque_retry.send_exceptions_when_retrying'] !retry_criteria_valid?(e) rescue => e Honeybadger.notify(e, parameters: { job_arguments: args }, sync: true) end