FIX: global setting needs to be coerced to float (#11162)
disable_search_queue_threshold needs to be coerced to a float so it is not treated as a string when sub second values are provided. Longer term fix is to possibly provide hints in the config so we do the coersion automatically. However this would be a far more complex change.
This commit is contained in:
parent
1455421433
commit
94cd5ac0b1
|
@ -173,9 +173,13 @@ class SearchController < ApplicationController
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def site_overloaded?
|
def site_overloaded?
|
||||||
(queue_time = request.env['REQUEST_QUEUE_SECONDS']) &&
|
queue_time = request.env['REQUEST_QUEUE_SECONDS']
|
||||||
(GlobalSetting.disable_search_queue_threshold > 0) &&
|
if queue_time
|
||||||
(queue_time > GlobalSetting.disable_search_queue_threshold)
|
threshold = GlobalSetting.disable_search_queue_threshold.to_f
|
||||||
|
threshold > 0 && queue_time > threshold
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def rate_limit_search
|
def rate_limit_search
|
||||||
|
|
Loading…
Reference in New Issue