Sha256: 80cdd0c6c3bfd82cfa8eb0e0bfebc96f0b6c47b924fa87170fe4fa29a752b5a4

Contents?: true

Size: 603 Bytes

Versions: 49

Compression:

Stored size: 603 Bytes

Contents

if defined?(::Unicorn)
  Appsignal.logger.info('Loading Unicorn integration')

  # We'd love to be able to hook this into Unicorn in a less
  # intrusive way, but this is the best we can do given the
  # options we have.

  class Unicorn::HttpServer
    alias_method :original_worker_loop, :worker_loop

    def worker_loop(worker)
      Appsignal.agent.forked!
      original_worker_loop(worker)
    end
  end

  class Unicorn::Worker
    alias_method :original_close, :close

    def close
      Appsignal.agent.shutdown(true, 'stopping Unicorn worker process')
      original_close
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
appsignal-0.11.18 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.17 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.16 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.15 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.14 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.14.beta.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.13 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.13.beta.4 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.13.beta.3 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.13.beta.2 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.13.beta.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.13.beta.0 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.12 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.11 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.10 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.10.beta.2 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.10.beta.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.9 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.8.beta.4 lib/appsignal/integrations/unicorn.rb
appsignal-0.11.8.beta.3 lib/appsignal/integrations/unicorn.rb