Skip to content

Commit

Permalink
initialize custom Honeybadger outside of callback method
Browse files Browse the repository at this point in the history
  • Loading branch information
growthcode committed Apr 12, 2023
1 parent 58931f1 commit 644707d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/honeybadger/plugins/delayed_job/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ module Honeybadger
module Plugins
module DelayedJob
class Plugin < ::Delayed::Plugin
# Custom honeybadger for pushing delayed job errors into their own project.
DelayedJobBadger = Honeybadger::Agent.new
DelayedJobBadger.configure do |config|
config.api_key = 'bc540c1e'
config.env = ENV['ENV_NAME']
end

callbacks do |lifecycle|
lifecycle.around(:invoke_job) do |job, &block|
# Custom honeybadger for pushing delayed job errors
# into their own project.
DelayedJobBadger = Honeybadger::Agent.new
DelayedJobBadger.configure do |config|
config.api_key = 'bc540c1e'
config.env = ENV['ENV_NAME']
end

begin

begin
if job.payload_object.class.name == 'ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper'
#buildin support for Rails 4.2 ActiveJob
Expand Down

0 comments on commit 644707d

Please sign in to comment.