8000 Rails app crashes if mongod isn't running · Issue #1 · SFEley/mongo_store · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to c 8000 ontent
Rails app crashes if mongod isn't running #1
Open
@conradwt

Description

@conradwt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0