Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved code readability

  • Loading branch information...
commit 8c8fdf6006f9ba0da4bae85f4b6e71fea70203c9 1 parent accc79a
@veloper authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/zeusd/daemon.rb
View
9 lib/zeusd/daemon.rb
@@ -42,15 +42,18 @@ def stop!
(zeus_socket_file.delete rescue nil) if zeus_socket_file.exist?
# Check for remaining processes
- if[process, process.descendants].flatten.select(&:alive?).any?
- raise DaemonException, "Unable to KILL processes: " + alive_processes.join(', ')
- end
+ living_processes = processes.select(&:alive?)
+ raise DaemonException, "Unable to KILL processes: " + living_processes.join(', ') if living_processes.any?
@process = nil
self
end
+ def processes
+ process ? [process, process.descendants].flatten : []
+ end
+
def process
@process ||= Process.all.find {|p| !!p.command[/zeus.*start$/] && p.cwd == cwd }
end
Please sign in to comment.
Something went wrong with that request. Please try again.