From 5139bbfd22c48e29ea6c66d3e47631877db65492 Mon Sep 17 00:00:00 2001 From: Ian Ownbey Date: Sat, 22 Nov 2008 18:56:06 -0800 Subject: Join thread at the end of start --- lib/mongrel.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/mongrel.rb b/lib/mongrel.rb index 423abeb..57b849b 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -101,7 +101,7 @@ module Mongrel @workers = ThreadGroup.new # Set default opts @app = app - @num_processors = opts.delete(:num_processors) + @num_processors = opts.delete(:num_processors) || 950 @throttle = (opts.delete(:throttle) || 0) / 100 @timeout = opts.delete(:timeout) || 60 end @@ -244,7 +244,6 @@ module Mongrel # Runs the thing. It returns the thread used so you can "join" it. You can also # access the HttpServer::acceptor attribute to get the thread later. def start! - p @num_processors BasicSocket.do_not_reverse_lookup=true configure_socket_options @@ -264,7 +263,6 @@ module Mongrel end worker_list = @workers.list - if worker_list.length >= @num_processors STDERR.puts "Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection." client.close rescue nil @@ -296,7 +294,7 @@ module Mongrel end end - return @acceptor + return @acceptor.join end # Simply registers a handler with the internal URIClassifier. When the URI is -- cgit v1.2.3-24-ge0c7