]> git.openstreetmap.org Git - rails.git/commitdiff
Timeout instantly if web_timeout setting is negative
authorAnton Khorev <tony29@yandex.ru>
Sat, 23 Mar 2024 18:02:48 +0000 (21:02 +0300)
committerAnton Khorev <tony29@yandex.ru>
Mon, 9 Sep 2024 15:16:16 +0000 (18:16 +0300)
app/controllers/application_controller.rb

index 4b36607bb00a988b671ce3f2da760633f0aabeba..8290a027eecce8270e3e1241de40980977ead5dd 100644 (file)
@@ -216,6 +216,8 @@ class ApplicationController < ActionController::Base
   ##
   # wrap a web page in a timeout
   def web_timeout(&block)
+    raise Timeout::Error if Settings.web_timeout.negative?
+
     Timeout.timeout(Settings.web_timeout, &block)
   rescue ActionView::Template::Error => e
     e = e.cause