]> git.openstreetmap.org Git - rails.git/commitdiff
Move memcached for caching if enabled regardless of environment
authorTom Hughes <tom@compton.nu>
Sun, 22 Feb 2015 19:10:15 +0000 (19:10 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 22 Feb 2015 19:21:34 +0000 (19:21 +0000)
config/application.rb
config/environments/production.rb

index 8ba628c8e3d955166fef1840b1379501cd9d03ca..bee36fa2ae72db8711ec202ab2ffe0a5085cf825 100644 (file)
@@ -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
index 707202c52225a818be09fa87fc78aad86df9f35c..ccba43daafd5df6a919dae258fac24d94a6c3254 100644 (file)
@@ -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