From: Tom Hughes <tom@compton.nu>
Date: Mon, 29 Jan 2024 19:37:59 +0000 (+0000)
Subject: Attempt to make timeouts work properly
X-Git-Tag: live~1432
X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/24f579562fbaf1ec9138014b0f2ed8e219eb75f7

Attempt to make timeouts work properly
---

diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index 7e1b06a8d..75db7f73b 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -177,7 +177,7 @@ class ApiController < ApplicationController
   ##
   # wrap an api call in a timeout
   def api_call_timeout(&block)
-    Timeout.timeout(Settings.api_timeout, Timeout::Error, &block)
+    Timeout.timeout(Settings.api_timeout, &block)
   rescue ActionView::Template::Error => e
     e = e.cause
 
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c830d4bcd..0a7df0994 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base
   ##
   # wrap a web page in a timeout
   def web_timeout(&block)
-    Timeout.timeout(Settings.web_timeout, Timeout::Error, &block)
+    Timeout.timeout(Settings.web_timeout, &block)
   rescue ActionView::Template::Error => e
     e = e.cause