Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- memcached_config_path = File.join(Rails.root, 'config', 'memcached.yml')
- if File.exists?(memcached_config_path)
- # create a memcache instance with multiple servers
- memcached_config = YAML::load(File::read(memcached_config_path))
- args = [:mem_cache_store]
- args << memcached_config[:defaults][:servers]
- args << { :namespace => memcached_config[:defaults][:namespace] }
- args.flatten!
- ActionController::Base.cache_store = *args
- ActionController::Base.perform_caching = true
- end
- rescue Exception => e
- Rails.logger.error("failed to initialize memcache store: #{e}")
- end
Add Comment
Please, Sign In to add comment