mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:41:24 +08:00
DEV: ensure queue_time and background_requests are floats (#10901)
GlobalSetting can end up with a String and we expect a Float
This commit is contained in:
@ -330,7 +330,8 @@ module Middleware
|
||||
end
|
||||
|
||||
if (env["HTTP_DISCOURSE_BACKGROUND"] == "true") && (queue_time = env["REQUEST_QUEUE_SECONDS"])
|
||||
if queue_time > GlobalSetting.background_requests_max_queue_length
|
||||
max_time = GlobalSetting.background_requests_max_queue_length.to_f
|
||||
if max_time > 0 && queue_time.to_f > max_time
|
||||
return [
|
||||
429,
|
||||
{
|
||||
|
Reference in New Issue
Block a user