Sha256: 09c692f83aad46c34a843f782f9eae911462cdf0c184248ec6851dfb3ffe517c

Contents?: true

Size: 783 Bytes

Versions: 51

Compression:

Stored size: 783 Bytes

Contents

require 'honeybadger/plugin'
require 'honeybadger/agent'

module Honeybadger
  module Plugins
    module Unicorn
      module AfterForkExtension
        def self.included(base)
          base.send(:alias_method, :init_worker_process_without_honeybadger, :init_worker_process)
          base.send(:alias_method, :init_worker_process, :init_worker_process_with_honeybadger)
        end

        def init_worker_process_with_honeybadger(*args, &block)
          init_worker_process_without_honeybadger(*args, &block).tap do
            Honeybadger::Agent.fork
          end
        end
      end

      Plugin.register do
        requirement { defined?(::Unicorn::HttpServer) }

        execution { ::Unicorn::HttpServer.send(:include, AfterForkExtension) }
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
honeybadger-2.7.2 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.7.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.7.0 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.6.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.6.0 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.5.3 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.5.2 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.5.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.5.0 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.4.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.4.0 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.3.3 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.3.2 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.3.2.beta.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.3.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.3.0 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.2.0 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.2.0.beta.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.1.6.beta.1 lib/honeybadger/plugins/unicorn.rb
honeybadger-2.1.5 lib/honeybadger/plugins/unicorn.rb