mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
FIX: handle heroku style HTTP_X_REQUEST_START (#10087)
This commit is contained in:
parent
a99bb0ded4
commit
8a86705e51
@ -145,7 +145,11 @@ class Middleware::RequestTracker
|
|||||||
def self.populate_request_queue_seconds!(env)
|
def self.populate_request_queue_seconds!(env)
|
||||||
if !env['REQUEST_QUEUE_SECONDS']
|
if !env['REQUEST_QUEUE_SECONDS']
|
||||||
if queue_start = env['HTTP_X_REQUEST_START']
|
if queue_start = env['HTTP_X_REQUEST_START']
|
||||||
queue_start = queue_start.split("t=")[1].to_f
|
queue_start = if queue_start.start_with?("t=")
|
||||||
|
queue_start.split("t=")[1].to_f
|
||||||
|
else
|
||||||
|
queue_start.to_f / 1000.0
|
||||||
|
end
|
||||||
queue_time = (Time.now.to_f - queue_start)
|
queue_time = (Time.now.to_f - queue_start)
|
||||||
env['REQUEST_QUEUE_SECONDS'] = queue_time
|
env['REQUEST_QUEUE_SECONDS'] = queue_time
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user