From b2bf95479e2bf2605a23d6abc21c2bcd359c399c Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Tue, 10 Apr 2012 20:35:03 -0700 Subject: [PATCH] Refactor #stop to reference ALL_PROCESSES for a bit clearer readability --- lib/foreman/engine.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb index fcaf512..bd75cd4 100644 --- a/lib/foreman/engine.rb +++ b/lib/foreman/engine.rb @@ -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