Sha256: c28dfa973261116395ef174d6a64a0507cfe5098e6df6ee2cf0f34968c2f120d

Contents?: true

Size: 527 Bytes

Versions: 5

Compression:

Stored size: 527 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 => ex
        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

5 entries across 5 versions & 1 rubygems

Version Path
bugsnag-1.8.1 lib/bugsnag/sidekiq.rb
bugsnag-1.8.0 lib/bugsnag/sidekiq.rb
bugsnag-1.7.0 lib/bugsnag/sidekiq.rb
bugsnag-1.6.5 lib/bugsnag/sidekiq.rb
bugsnag-1.6.4 lib/bugsnag/sidekiq.rb