1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Force a worker check after a worker boots, don't wait 5sec. Fixes #574

This commit is contained in:
Evan Phoenix 2014-09-05 11:30:22 -07:00
parent d33ae0f050
commit 3cbe5219a2

View file

@ -125,8 +125,8 @@ module Puma
@workers.count { |w| !w.booted? } == 0
end
def check_workers
return if @next_check && @next_check >= Time.now
def check_workers(force=false)
return if !force && @next_check && @next_check >= Time.now
@next_check = Time.now + 5
@ -357,6 +357,8 @@ module Puma
begin
res = IO.select([read], nil, nil, 5)
force_check = false
if res
req = read.read_nonblock(1)
@ -369,6 +371,7 @@ module Puma
when "b"
w.boot!
log "- Worker #{w.index} (pid: #{pid}) booted, phase: #{w.phase}"
force_check = true
when "p"
w.ping!
end
@ -382,7 +385,7 @@ module Puma
@phased_restart = false
end
check_workers
check_workers force_check
rescue Interrupt
@status = :stop