1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 20:17:45 +01:00

[fix] measure request duration only if total_time attribute is set - fixes autocompleter

This commit is contained in:
Adam Tauber 2017-11-23 01:52:45 +01:00
parent 060c797739
commit 27e95846ea

View File

@ -122,8 +122,8 @@ def request(method, url, **kwargs):
# session end
session.close()
#
threadLocal.total_time += time_after_request - time_before_request
if hasattr(threadLocal, 'total_time'):
threadLocal.total_time += time_after_request - time_before_request
return response