Sha256: 33690d8aa600a795535efaa09fd3f2ed5054b76272b0dc1c12aae5bb552dca17

Contents?: true

Size: 744 Bytes

Versions: 3

Compression:

Stored size: 744 Bytes

Contents

module Honeybadger
  module Plugins
    module ActiveJob
            
      Plugin.register {
        requirement { defined?(::Rails.application) && ::Rails.application }
        requirement { 
          ::Rails.application.config.active_job[:queue_adapter] == :async
        }
        
        execution {
          ::ActiveJob::Base.class_eval do |base| 
            base.set_callback :perform, :around do |param, block|
              Honeybadger.clear!
              begin
                block.call
              rescue => error
                Honeybadger.notify(error, parameters: { job_arguments: self.arguments })
                raise error
              end
            end
          end          
        }
      }
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
honeybadger-5.5.0 lib/honeybadger/plugins/active_job.rb
honeybadger-5.4.1 lib/honeybadger/plugins/active_job.rb
honeybadger-5.4.0 lib/honeybadger/plugins/active_job.rb