Sha256: fffe3cf9b6fea45db95c028a0995d2dd515e03666b963fde5a80a400da632fa7

Contents?: true

Size: 622 Bytes

Versions: 3

Compression:

Stored size: 622 Bytes

Contents

module Honeybadger
  module Integrations
    module Sidekiq
      class Middleware
        def call(worker, msg, queue)
          Honeybadger.context.clear!
          yield
        end
      end
    end
  end
end

if defined?(::Sidekiq)
  ::Sidekiq.configure_server do |config|
    config.server_middleware do |chain|
      chain.add Honeybadger::Integrations::Sidekiq::Middleware
    end
  end
end

if defined?(::Sidekiq::VERSION) && ::Sidekiq::VERSION > '3'
  ::Sidekiq.configure_server do |config|
    config.error_handlers << Proc.new {|ex,context| Honeybadger.notify_or_ignore(ex, :parameters => context) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
honeybadger-1.13.2 lib/honeybadger/integrations/sidekiq.rb
honeybadger-1.13.1 lib/honeybadger/integrations/sidekiq.rb
honeybadger-1.13.0 lib/honeybadger/integrations/sidekiq.rb