From 50f3c3cc40bc3e1fffe37f9f2c6b51385cc94af9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Oct 2005 13:48:03 +0000 Subject: Updated documentation and fixed the spinner to reference the new spawner by default git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2610 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/commands/process/reaper.rb | 7 ++----- railties/lib/commands/process/spinner.rb | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'railties/lib/commands') diff --git a/railties/lib/commands/process/reaper.rb b/railties/lib/commands/process/reaper.rb index b5b82c310f..1a08cb1def 100644 --- a/railties/lib/commands/process/reaper.rb +++ b/railties/lib/commands/process/reaper.rb @@ -90,13 +90,10 @@ ARGV.options do |opts| Restart is the most common and default action. - A nudge is simply a request to a URL where the dispatcher is serving. You should perform one nudge per - FCGI process you have running if they're setup in a round-robin. Be sure to do one nudge per FCGI process - across all your servers. So three servers with 10 processes each should nudge 30 times to be sure all processes - are restarted. - Examples: + reaper # restarts the default dispatcher reaper -a reload + reaper -a exit -d /my/special/dispatcher.fcgi EOF opts.on(" Options:") diff --git a/railties/lib/commands/process/spinner.rb b/railties/lib/commands/process/spinner.rb index 1573ca0740..161623c622 100644 --- a/railties/lib/commands/process/spinner.rb +++ b/railties/lib/commands/process/spinner.rb @@ -12,10 +12,9 @@ def daemonize end OPTIONS = { - :high_interval => 5.0, - :low_interval => 0.5, - :command => File.expand_path(RAILS_ROOT + '/script/run process spawner'), - :daemon => false + :interval => 5.0, + :command => File.expand_path(RAILS_ROOT + '/script/process/spawner'), + :daemon => false } ARGV.options do |opts| @@ -26,7 +25,7 @@ ARGV.options do |opts| opts.on <<-EOF Description: The spinner is a protection loop for the spawner, which will attempt to restart any FCGI processes - that might have been restarted or outright crashed. It's a brute-force attempt that'll just try + that might have been exited or outright crashed. It's a brute-force attempt that'll just try to run the spawner every X number of seconds, so it does pose a light load on the server. Examples: @@ -37,10 +36,9 @@ ARGV.options do |opts| opts.on(" Options:") - opts.on("-c", "--command=path", String) { |OPTIONS[:command]| } - opts.on("-h", "--high-interval=seconds", Float) { |OPTIONS[:high_interval]| } - opts.on("-l", "--low-interval=seconds", Float) { |OPTIONS[:low_interval]| } - opts.on("-d", "--daemon") { |OPTIONS[:daemon]| } + opts.on("-c", "--command=path", String) { |OPTIONS[:command]| } + opts.on("-i", "--interval=seconds", Float) { |OPTIONS[:interval]| } + opts.on("-d", "--daemon") { |OPTIONS[:daemon]| } opts.separator "" @@ -52,14 +50,8 @@ end daemonize if OPTIONS[:daemon] trap(OPTIONS[:daemon] ? "TERM" : "INT") { exit } -trap("USR1") do - $interval = ($interval == OPTIONS[:high_interval] ? OPTIONS[:low_interval] : OPTIONS[:high_interval]) - puts "New interval: #{$interval}" -end - -$interval = OPTIONS[:high_interval] loop do system(OPTIONS[:command]) - sleep($interval) + sleep(OPTIONS[:interval]) end \ No newline at end of file -- cgit v1.2.3