From: Tom Hughes Date: Sun, 22 Feb 2015 19:10:15 +0000 (+0000) Subject: Move memcached for caching if enabled regardless of environment X-Git-Tag: live~4213 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/9e160ec176ecdc5bea245566f211b6eec20208cd Move memcached for caching if enabled regardless of environment --- diff --git a/config/application.rb b/config/application.rb index 8ba628c8e..bee36fa2a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -43,5 +43,10 @@ module OpenStreetMap # Don't eager load models when the database is offline config.paths["app/models"].skip_eager_load! if STATUS == :database_offline + + # Use memcached for caching if required + if defined?(MEMCACHE_SERVERS) + config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" } + end end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 707202c52..ccba43daa 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -58,9 +58,7 @@ OpenStreetMap::Application.configure do # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production. - if defined?(MEMCACHE_SERVERS) - config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" } - end + # config.cache_store = :mem_cache_store # Configure caching of static assets config.action_controller.page_cache_directory = Rails.public_path