mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Make phased_restart fallback to restart if not available
This commit is contained in:
parent
0ded7fbbdd
commit
09eb0cc020
2 changed files with 10 additions and 12 deletions
|
@ -463,6 +463,14 @@ module Puma
|
|||
log "*** SIGUSR2 not implemented, signal based restart unavailable!"
|
||||
end
|
||||
|
||||
begin
|
||||
Signal.trap "SIGUSR1" do
|
||||
phased_restart
|
||||
end
|
||||
rescue Exception
|
||||
log "*** SIGUSR1 not implemented, signal based restart unavailable!"
|
||||
end
|
||||
|
||||
begin
|
||||
Signal.trap "SIGTERM" do
|
||||
stop
|
||||
|
@ -491,8 +499,8 @@ module Puma
|
|||
end
|
||||
|
||||
def phased_restart
|
||||
return false unless @runner.respond_to? :phased_restart
|
||||
@runner.phased_restart
|
||||
return restart unless @runner.respond_to? :phased_restart
|
||||
return restart unless @runner.phased_restart
|
||||
end
|
||||
|
||||
def stats
|
||||
|
|
|
@ -233,16 +233,6 @@ module Puma
|
|||
end
|
||||
end
|
||||
|
||||
if preload?
|
||||
Signal.trap "SIGUSR1" do
|
||||
log "App preloaded, phased restart unavailable"
|
||||
end
|
||||
else
|
||||
Signal.trap "SIGUSR1" do
|
||||
phased_restart
|
||||
end
|
||||
end
|
||||
|
||||
# Used by the workers to detect if the master process dies.
|
||||
# If select says that @check_pipe is ready, it's because the
|
||||
# master has exited and @suicide_pipe has been automatically
|
||||
|
|
Loading…
Add table
Reference in a new issue