From 8ad43f01c2dfd06de907a87ab8cd2c1de3458944 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 19 Jan 2018 10:37:27 +1100 Subject: [PATCH] FIX: correctly log topic timings as background --- lib/hijack.rb | 2 +- lib/middleware/request_tracker.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hijack.rb b/lib/hijack.rb index 74efe769789..a8a1268fb1d 100644 --- a/lib/hijack.rb +++ b/lib/hijack.rb @@ -89,7 +89,7 @@ module Hijack io.close if io rescue nil if request_tracker - status = instance.status rescue 500 + status = response.status rescue 500 request_tracker.log_request_info(env, [status, headers || {}, []], timings) end end diff --git a/lib/middleware/request_tracker.rb b/lib/middleware/request_tracker.rb index 052b665bc4d..e544e55516b 100644 --- a/lib/middleware/request_tracker.rb +++ b/lib/middleware/request_tracker.rb @@ -97,7 +97,7 @@ class Middleware::RequestTracker status: status, is_crawler: helper.is_crawler?, has_auth_cookie: helper.has_auth_cookie?, - is_background: request.path =~ /^\/message-bus\// || request.path == /\/topics\/timings/, + is_background: !!(request.path =~ /^\/message-bus\// || request.path =~ /\/topics\/timings/), is_mobile: helper.is_mobile?, track_view: track_view, timing: timing