]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Use Timeout if SystemTimer isn't loaded
[rails.git] / app / controllers / application_controller.rb
index 96bf915c0f9e3034fe9c0cb2029c1feb8ae1861b..e64e2e022fca6b92ef8d5f464206195e8d405e2c 100644 (file)
@@ -286,7 +286,7 @@ class ApplicationController < ActionController::Base
   ##
   # wrap an api call in a timeout
   def api_call_timeout
-    SystemTimer.timeout_after(API_TIMEOUT) do
+    OSM::Timer.timeout(API_TIMEOUT) do
       yield
     end
   rescue Timeout::Error
@@ -296,7 +296,7 @@ class ApplicationController < ActionController::Base
   ##
   # wrap a web page in a timeout
   def web_timeout
-    SystemTimer.timeout_after(WEB_TIMEOUT) do
+    OSM::Timer.timeout(WEB_TIMEOUT) do
       yield
     end
   rescue ActionView::TemplateError => ex