Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails app crashes if mongod isn't running #1

Open
conradwt opened this issue Sep 14, 2010 · 0 comments
Open

Rails app crashes if mongod isn't running #1

conradwt opened this issue Sep 14, 2010 · 0 comments

Comments

@conradwt
Copy link

How does one create a fallback scheme when using mongo_store? For example, if one cannot connect to Mongo, it crashes the entire application.

BEGIN Error:

Mongo::ConnectionFailure (failed to connect to any given host:port):
mongo (1.0.8) lib/./lib/mongo/connection.rb:489:in connect' mongo (1.0.8) lib/./lib/mongo/connection.rb:137:ininitialize'
vendor/spree/lib/preference_access.rb:9:in []' vendor/extensions/sd_main/app/controllers/spree/base_controller.rb:273:inset_user_language'
vendor/gems/hoptoad_notifier-2.2.2/lib/hoptoad_notifier/rack.rb:27:in call' /Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:104:inservice'
/Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:173:instart_thread'
/Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in start' /Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:instart_thread'
/Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:95:in start' /Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:ineach'
/Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in start' /Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:23:instart'
/Users/conradwt/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:82:in `start'

END Error:

BTW, I have the following within my production.rb:

Set the cache store for Mongod.

config.cache_store = :mongo_store

In short, I would prefer that it work similar to memcached where it doesn't crash the Rails application when memcached is down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant