From eb8e5ea6c646e1c82aadb0041338cbfd83b926f8 Mon Sep 17 00:00:00 2001 From: evanweaver Date: Thu, 18 Oct 2007 19:59:27 +0000 Subject: redirect git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@690 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel/configurator.rb | 4 ++-- 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/")) -- cgit v1.2.3-24-ge0c7