]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Make database offline work in production
[rails.git] / app / controllers / trace_controller.rb
index f8ce29abaaa972fff209b37189daff2f623189cb..c51f54c5e713b13899e2bb606b1875c5e6c8037b 100644 (file)
@@ -18,8 +18,8 @@ class TraceController < ApplicationController
   caches_action :list, :unless => :logged_in?, :layout => false
   caches_action :view, :layout => false
   caches_action :georss, :layout => true
   caches_action :list, :unless => :logged_in?, :layout => false
   caches_action :view, :layout => false
   caches_action :georss, :layout => true
-  cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create]
-  cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create]
+  cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create], :unless => OSM_STATUS == :database_offline
+  cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create], :unless => OSM_STATUS == :database_offline
 
   # Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
   #  target_user - if set, specifies the user to fetch traces for.  if not set will fetch all traces
 
   # Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
   #  target_user - if set, specifies the user to fetch traces for.  if not set will fetch all traces