Timeout instantly if web_timeout setting is negative
This commit is contained in:
parent
2140da75b7
commit
51e0cf85b0
1 changed files with 2 additions and 0 deletions
|
@ -216,6 +216,8 @@ class ApplicationController < ActionController::Base
|
||||||
##
|
##
|
||||||
# wrap a web page in a timeout
|
# wrap a web page in a timeout
|
||||||
def web_timeout(&block)
|
def web_timeout(&block)
|
||||||
|
raise Timeout::Error if Settings.web_timeout.negative?
|
||||||
|
|
||||||
Timeout.timeout(Settings.web_timeout, &block)
|
Timeout.timeout(Settings.web_timeout, &block)
|
||||||
rescue ActionView::Template::Error => e
|
rescue ActionView::Template::Error => e
|
||||||
e = e.cause
|
e = e.cause
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue