1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Small tweak to make sure the stop gets through.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@70 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
zedshaw 2006-03-03 02:48:46 +00:00
parent c2efd0fcc1
commit 918342bc14
2 changed files with 8 additions and 7 deletions

View file

@ -18,7 +18,7 @@ class Start < Mongrel::Plugin "/commands"
['-m', '--mime PATH', "A YAML file that lists additional MIME types", :@mime_map, nil],
['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd],
['-r', '--root PATH', "Set the document root (default 'public')", :@docroot, "public"],
['-L', '--load PATH', "Loads plugins from the given directory", :@load_from, nil]
['-L', '--load PATH', "Loads plugins from the given directory", :@load_from, nil],
]
end
@ -85,7 +85,6 @@ class Start < Mongrel::Plugin "/commands"
def start_mongrel(rails)
@restart = false
# start up mongrel with the right configurations
server = Mongrel::HttpServer.new(@address, @port, @num_procs.to_i, @timeout.to_i)
server.register("/", rails)
server.run

View file

@ -342,9 +342,8 @@ module Mongrel
# systems. If you find that you overload Mongrel too much
# try changing it higher. If you find that responses are way too slow
# try lowering it (after you've tuned your stuff of course).
# Future versions of Mongrel will make this more dynamic (hopefully).
def initialize(host, port, num_processors=20, timeout=120)
@socket = TCPServer.new(host, port)
@socket = TCPServer.new(host, port)
@classifier = URIClassifier.new
@req_queue = Queue.new
@ -465,9 +464,12 @@ module Mongrel
# Stops the acceptor thread and then causes the worker threads to finish
# off the request queue before finally exiting.
def stop
@acceptor[:stopped] = true
exc = StopServer.new
@acceptor.raise(exc)
stopper = Thread.new do
@acceptor[:stopped] = true
exc = StopServer.new
@acceptor.raise(exc)
end
stopper.priority = 10
end
end