Alain Ravet
2006-Jul-28 13:35 UTC
[Rails] How to detect and simply signal that the DB is/got down?
Hi all,
If the DB server is down when the rails server starts, or if it gets
down while the rails server is running, I need to
- detect the problem
- display a simple error message "DB is down: contact support".
Inserting
ActiveRecord::Base.retrieve_connection()
at the very begining of ApplicationController will trigger an error -
that can be captured - when the class is loaded, but before the
controller is instantiated => cannot render anything.
And it would not help if the DB gets down after the app has been running
(and the controller has been cached).
How can I solve this problem?
Thanks in advance.
Alain
--
Posted via http://www.ruby-forum.com/.
