Added 'port open?' check to the spawner when running in repeat mode so we...

Added 'port open?' check to the spawner when running in repeat mode so we don't needlessly boot the dispatcher if the port is already in use anyway #4089 [guy.naor@famundo.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3938 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 3dc7f760
*SVN*
* Added 'port open?' check to the spawner when running in repeat mode so we don't needlessly boot the dispatcher if the port is already in use anyway #4089 [guy.naor@famundo.com]
* Add verification to generated scaffolds, don't allow get for unsafe actions [Michael Koziarski]
* Don't replace application.js in public/javascripts if it already exists [Cody Fauser]
......
require 'optparse'
require 'socket'
def spawn(port)
puts "Starting FCGI on port: #{port}"
system("#{OPTIONS[:spawner]} -f #{OPTIONS[:dispatcher]} -p #{port}")
print "Checking if something is already running on port #{port}..."
begin
srv = TCPServer.new('0.0.0.0', port)
srv.close
srv = nil
print "NO\n "
print "Starting FCGI on port: #{port}\n "
system("#{OPTIONS[:spawner]} -f #{OPTIONS[:dispatcher]} -p #{port}")
rescue
print "YES\n"
end
end
def spawn_all
OPTIONS[:instances].times { |i| spawn(OPTIONS[:port] + i) }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册