From 24f579562fbaf1ec9138014b0f2ed8e219eb75f7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 29 Jan 2024 19:37:59 +0000 Subject: [PATCH] Attempt to make timeouts work properly --- app/controllers/api_controller.rb | 2 +- app/controllers/application_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5