Refactor #stop to reference ALL_PROCESSES for a bit clearer readability
This commit is contained in:
@@ -63,7 +63,7 @@ class Foreman::Engine
|
||||
|
||||
def stop(name, signal='SIGTERM')
|
||||
running_processes.each do |pid, process|
|
||||
unless name.nil?
|
||||
unless name == ALL_PROCESSES
|
||||
# Comparing against process.entry.name instead of process.name to
|
||||
# make sure we match the process name exactly for any/all
|
||||
# concurrently running processes by this name
|
||||
@@ -104,10 +104,10 @@ private ######################################################################
|
||||
return if @terminating
|
||||
@terminating = true
|
||||
Timeout.timeout(5) do
|
||||
stop(nil)
|
||||
stop ALL_PROCESSES
|
||||
end
|
||||
rescue Timeout::Error
|
||||
stop(nil, 'SIGKILL')
|
||||
stop(ALL_PROCESSES, 'SIGKILL')
|
||||
rescue Errno::ECHILD
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user