Skip to content

Commit

Permalink
Move the Sidekiq reporter to after the logging middleware (bugsnag#326)
Browse files Browse the repository at this point in the history
The Server::Logging middleware is the outermost middleware that Sidekiq provides by default.
This is a very safe place to put error reporting middleware, because any custom code implemented
by users of Bugsnag will probably not cause erroneous reports.

Closes bugsnag#326
  • Loading branch information
sb8244 authored and kattrali committed Apr 7, 2017
1 parent f9f59b8 commit c7862ea
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/bugsnag/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ def call(worker, msg, queue)

::Sidekiq.configure_server do |config|
config.server_middleware do |chain|
if Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('3.3.0')
chain.prepend ::Bugsnag::Sidekiq
else
chain.add ::Bugsnag::Sidekiq
end
chain.insert_after ::Sidekiq::Middleware::Server::Logging, ::Bugsnag::Sidekiq
end
end

0 comments on commit c7862ea

Please sign in to comment.