Sha256: 65a2e385574d2e3c3e9219544554f8aa2f3f851a358f0a3dfd1e5001aa4eb533

Contents?: true

Size: 785 Bytes

Versions: 5

Compression:

Stored size: 785 Bytes

Contents

require 'shoryuken'

module Bugsnag
  class Shoryuken
    def initialize
      Bugsnag.configuration.app_type = "shoryuken"
      Bugsnag.configuration.default_delivery_method = :synchronous
    end

    def call(_, queue, _, body)
      begin
        Bugsnag.before_notify_callbacks << lambda {|notification|
          notification.add_tab(:shoryuken, {
            queue: queue,
            body: body
          })
        }

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bugsnag-5.3.3 lib/bugsnag/shoryuken.rb
bugsnag-5.3.2 lib/bugsnag/shoryuken.rb
bugsnag-5.3.1 lib/bugsnag/shoryuken.rb
bugsnag-5.3.0 lib/bugsnag/shoryuken.rb
bugsnag-5.2.0 lib/bugsnag/shoryuken.rb