aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/dispatcher.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-06-29 11:07:20 +0000
committerJamis Buck <jamis@37signals.com>2005-06-29 11:07:20 +0000
commit3cc47a4297d9c43e88972555e853e2d5359d804f (patch)
treee020dbfe531b90316377664ef6bfeca8f3976f73 /railties/lib/dispatcher.rb
parent8335fc610c7f2f5bc1d4b0e01370013bfccdba81 (diff)
downloadrails-3cc47a4297d9c43e88972555e853e2d5359d804f.tar.gz
rails-3cc47a4297d9c43e88972555e853e2d5359d804f.tar.bz2
rails-3cc47a4297d9c43e88972555e853e2d5359d804f.zip
Use SIGHUP to dynamically reload an fcgi process without restarting it. Refactored dispatch.fcgi so that the RailsFCGIHandler is in the lib dir.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1565 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/dispatcher.rb')
-rw-r--r--railties/lib/dispatcher.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb
index 1455168ba9..aaea8dd277 100644
--- a/railties/lib/dispatcher.rb
+++ b/railties/lib/dispatcher.rb
@@ -33,9 +33,16 @@ class Dispatcher
rescue Object => exception
ActionController::Base.process_with_exception(request, response, exception).out(output)
ensure
- reset_application
+ reset_after_dispatch
end
end
+
+ def reset_application!
+ Controllers.clear!
+ Dependencies.clear
+ Dependencies.remove_subclasses_for(ActiveRecord::Base, ActiveRecord::Observer, ActionController::Base)
+ Dependencies.remove_subclasses_for(ActionMailer::Base) if defined?(ActionMailer::Base)
+ end
private
def prepare_application
@@ -44,14 +51,8 @@ class Dispatcher
Controllers.const_load!(:ApplicationController, "application") unless Controllers.const_defined?(:ApplicationController)
end
- def reset_application
- if Dependencies.load?
- Controllers.clear!
- Dependencies.clear
- Dependencies.remove_subclasses_for(ActiveRecord::Base, ActiveRecord::Observer, ActionController::Base)
- Dependencies.remove_subclasses_for(ActionMailer::Base) if defined?(ActionMailer::Base)
- end
-
+ def reset_after_dispatch
+ reset_application! if Dependencies.load?
Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT)
end
end