diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-18 19:59:27 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-18 19:59:27 +0000 |
commit | eb8e5ea6c646e1c82aadb0041338cbfd83b926f8 (patch) | |
tree | 1e311527d6a88738214c9cc89f7fa8d0ad9a091b | |
parent | 64a213128f302128e6a8f2b5d8cdcd3006558019 (diff) | |
download | unicorn-eb8e5ea6c646e1c82aadb0041338cbfd83b926f8.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@690 19e92222-5c0b-0410-8929-a290d50e31e9
-rw-r--r-- | lib/mongrel/configurator.rb | 4 | ||||
-rw-r--r-- | test/test_configurator.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index 5d5d374..ad88bb8 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -287,11 +287,11 @@ 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, asynchronous=true) + def stop(needs_restart=false, synchronous=true) @listeners.each {|name,s| s.stop } - unless asynchronous + if synchronous sleep(0.5) while (@listeners.map do |name, listener| listener.acceptor.alive? end.any?) diff --git a/test/test_configurator.rb b/test/test_configurator.rb index 5d1bee9..d8e9a11 100644 --- a/test/test_configurator.rb +++ b/test/test_configurator.rb @@ -77,9 +77,9 @@ class ConfiguratorTest < Test::Unit::TestCase assert $test_plugin_fired == 6, "Test filter plugin didn't run 6 times." end -# redirect_test_io do - config.stop(false, false) -# end + redirect_test_io do + config.stop(false, true) + end assert_raise Errno::EBADF, Errno::ECONNREFUSED do res = Net::HTTP.get(URI.parse("http://localhost:4501/")) |