Class: WorkerKiller::Killer::Signal

Inherits:
Base
  • Object
show all
Defined in:
lib/worker_killer/killer/signal.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #kill_attempts

Instance Method Summary collapse

Methods inherited from Base

#initialize, #kill, #logger

Constructor Details

This class inherits a constructor from WorkerKiller::Killer::Base

Instance Method Details

#do_kill(sig, pid, alive_sec, **params) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/worker_killer/killer/signal.rb', line 5

def do_kill(sig, pid, alive_sec, **params)
  return if sig == @last_signal

  @last_signal = sig
  logger.warn "#{self} send SIG#{sig} (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"
  Process.kill sig, pid
end