]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Use system_timer for timeouts to make them more reliable.
[rails.git] / app / controllers / application_controller.rb
index 479f24525bd106277699797d791e9f89af1994c1..53ad1e901c8d41187d3e588c95b8cd72161ea290 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
 
   ##