diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-18 19:27:33 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-18 19:27:33 +0000 |
commit | 9b23459be9faf307162ddab2c5a7fe6797952a13 (patch) | |
tree | 53e52214f29b9cf4eda649919f044b8d4194f237 /lib/mongrel | |
parent | a511323f71cc533b513ef54eaf1adbbf03624df9 (diff) | |
download | unicorn-9b23459be9faf307162ddab2c5a7fe6797952a13.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@687 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel')
-rw-r--r-- | lib/mongrel/configurator.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index c62f153..6c9a6c8 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -287,14 +287,10 @@ module Mongrel # Calls .stop on all the configured listeners so they # stop processing requests (gracefully). By default it # assumes that you don't want to restart. - def stop(needs_restart=false) - @listeners.map do |name, listener| - stopper = Thread.new { listener.stop } - stopper.priority = 10 - stopper - end.each do |stopper| - stopper.join - end + def stop(needs_restart=false, asynchronous=true) + @listeners.each {|name,s| + s.stop(asynchronous) + } @needs_restart = needs_restart end @@ -373,6 +369,8 @@ module Mongrel if RUBY_PLATFORM !~ /mswin/ # graceful shutdown trap("TERM") { log "TERM signal received."; stop } + trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client } + # restart trap("USR2") { log "USR2 signal received."; stop(true) } log "Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart)." |