]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
I really wish rails would stop trying to hide exceptions from me...
[rails.git] / app / controllers / application_controller.rb
index 479f24525bd106277699797d791e9f89af1994c1..dc17a21628b91885d46729fd27fd85d6bdb854e7 100644 (file)
@@ -208,9 +208,11 @@ class ApplicationController < ActionController::Base
   end
 
   def api_call_timeout
-    Timeout::timeout(APP_CONFIG['api_timeout'], OSM::APITimeoutError) do
+    SystemTimer.timeout_after(APP_CONFIG['api_timeout']) do
       yield
     end
+  rescue Timeout::Error
+    raise OSM::APITimeoutError
   end
 
   ##
@@ -240,7 +242,7 @@ class ApplicationController < ActionController::Base
   ##
   # extend expire_action to expire all variants
   def expire_action(options = {})
-    path = fragment_cache_key(options).gsub('?', '.').gsub(':', '.')
+    path = ActionCachePath.path_for(self, options, false).gsub('?', '.').gsub(':', '.')
     expire_fragment(Regexp.new(Regexp.escape(path) + "\\..*"))
   end