From 9fb24f1a4c724709eb66a94c8be30d362d74fabf Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Wed, 13 Dec 2017 18:49:26 -0500 Subject: [PATCH] add hack to TimingMiddlWare for Shippable tests --- awx/main/middleware.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/main/middleware.py b/awx/main/middleware.py index 3221ee27ea..b52bd6cfaa 100644 --- a/awx/main/middleware.py +++ b/awx/main/middleware.py @@ -43,6 +43,8 @@ class TimingMiddleware(threading.local): self.prof.enable() def process_response(self, request, response): + if not hasattr(self, 'start_time'): # some tools may not invoke process_request + return response total_time = time.time() - self.start_time response['X-API-Total-Time'] = '%0.3fs' % total_time if settings.AWX_REQUEST_PROFILE: