Sha256: 1415bb26db808a4de161d9b50fe20a1b51e836214062903c0da8c27d295d284c

Contents?: true

Size: 616 Bytes

Versions: 7

Compression:

Stored size: 616 Bytes

Contents

require 'sidekiq'

module Bugsnag
  class Sidekiq
    def call(worker, msg, queue)
      begin
        Bugsnag.before_notify_callbacks << lambda {|notif|
          notif.add_tab(:sidekiq, msg)
          notif.context ||= "sidekiq##{queue}"
        }

        yield
      rescue Exception => ex
        raise ex if [Interrupt, SystemExit, SignalException].include? ex.class
        Bugsnag.auto_notify(ex)
        raise
      ensure
        Bugsnag.clear_request_data
      end
    end
  end
end

::Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add ::Bugsnag::Sidekiq
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bugsnag-1.8.8 lib/bugsnag/sidekiq.rb
bugsnag-1.8.7 lib/bugsnag/sidekiq.rb
bugsnag-1.8.6 lib/bugsnag/sidekiq.rb
bugsnag-1.8.5 lib/bugsnag/sidekiq.rb
bugsnag-1.8.4 lib/bugsnag/sidekiq.rb
bugsnag-1.8.3 lib/bugsnag/sidekiq.rb
bugsnag-1.8.2 lib/bugsnag/sidekiq.rb