Created
November 11, 2009 18:03
-
-
Save etozzato/232154 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> Booting Mongrel | |
=> Rails 2.3.2 application starting on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
Mongrel: port 3000 is already in use, trying 3001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def initialize(host, port, num_processors=950, throttle=0, timeout=60) | |
tries = 0 | |
while @socket.nil? | |
begin | |
@socket = TCPServer.new(host, port) | |
rescue Errno::EADDRINUSE | |
STDERR.puts "Mongrel: port #{port} is already in use, trying #{port+1}" | |
port = 1 + port | |
end | |
end | |
@classifier = URIClassifier.new | |
@host = host | |
@port = port | |
@workers = ThreadGroup.new | |
@throttle = throttle / 100.0 | |
@num_processors = num_processors | |
@timeout = timeout | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment