diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-15 13:48:03 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-15 13:48:03 +0000 |
commit | 50f3c3cc40bc3e1fffe37f9f2c6b51385cc94af9 (patch) | |
tree | a7df162d50f31ef621aedc74eab59816fa61a232 /railties/lib/commands/process/spinner.rb | |
parent | 0930256b457bb5b7b959ca334dcaaeb595c26fc5 (diff) | |
download | rails-50f3c3cc40bc3e1fffe37f9f2c6b51385cc94af9.tar.gz rails-50f3c3cc40bc3e1fffe37f9f2c6b51385cc94af9.tar.bz2 rails-50f3c3cc40bc3e1fffe37f9f2c6b51385cc94af9.zip |
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
Diffstat (limited to 'railties/lib/commands/process/spinner.rb')
-rw-r--r-- | railties/lib/commands/process/spinner.rb | 24 |
1 files changed, 8 insertions, 16 deletions
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 |