Sha256: e439330e13a0e862e541ce5d1ca12f4e8646674d6e010aec70bb3784ec8623a3
Contents?: true
Size: 853 Bytes
Versions: 17
Compression:
Stored size: 853 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 if ::Sidekiq::VERSION < '3' ::Sidekiq.configure_server do |config| config.server_middleware do |chain| chain.add ::Bugsnag::Sidekiq end end else ::Sidekiq.configure_server do |config| config.error_handlers << lambda do |ex, ctx| Bugsnag.auto_notify(ex, :sidekiq => ctx, :context => "sidekiq##{ctx['queue']}") end end end
Version data entries
17 entries across 17 versions & 1 rubygems