add hack to TimingMiddlWare for Shippable tests

This commit is contained in:
AlanCoding 2017-12-13 18:49:26 -05:00
parent 2fb0144914
commit 9fb24f1a4c
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B

View File

@ -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: