Class: Gitlab::Memory::Watchdog::Handlers::PumaHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/memory/watchdog/handlers/puma_handler.rb

Overview

This handler invokes Puma’s graceful termination handler, which takes into account a configurable grace period during which a process may remain unresponsive to a SIGTERM.

Instance Method Summary collapse

Constructor Details

#initialize(puma_options = ::Puma.cli_config.options) ⇒ PumaHandler

Returns a new instance of PumaHandler.



11
12
13
# File 'lib/gitlab/memory/watchdog/handlers/puma_handler.rb', line 11

def initialize(puma_options = ::Puma.cli_config.options)
  @worker = ::Puma::Cluster::WorkerHandle.new(0, $$, 0, puma_options)
end

Instance Method Details

#callObject



15
16
17
18
# File 'lib/gitlab/memory/watchdog/handlers/puma_handler.rb', line 15

def call
  @worker.term
  true
end