mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Merge pull request #1748 from MSP-Greg/cluster_check_workers
Cluster#check_workers - waitpid logic
This commit is contained in:
commit
d770c33ab3
1 changed files with 2 additions and 7 deletions
|
@ -216,14 +216,9 @@ module Puma
|
|||
# during this loop by giving the kernel time to kill them.
|
||||
sleep 1 if any
|
||||
|
||||
while @workers.any?
|
||||
pid = Process.waitpid(-1, Process::WNOHANG)
|
||||
break unless pid
|
||||
@workers.reject! { |w| Process.waitpid(w.pid, Process::WNOHANG) }
|
||||
|
||||
@workers.delete_if { |w| w.pid == pid }
|
||||
end
|
||||
|
||||
@workers.delete_if(&:dead?)
|
||||
@workers.reject!(&:dead?)
|
||||
|
||||
cull_workers
|
||||
spawn_workers
|
||||
|
|
Loading…
Reference in a new issue