diff options
author | Adam Tauber <asciimoo@gmail.com> | 2017-11-23 01:52:45 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-11-23 01:52:54 +0100 |
commit | 27e95846ead37b0af6f514246e9784e33d1c373c (patch) | |
tree | 9abf160a2df21727982146b9e54c6581dd7e56da /searx/poolrequests.py | |
parent | 060c797739c4b2c62be1e4d19963c3a5565486ed (diff) | |
download | searxng-27e95846ead37b0af6f514246e9784e33d1c373c.tar.gz searxng-27e95846ead37b0af6f514246e9784e33d1c373c.zip |
[fix] measure request duration only if total_time attribute is set - fixes autocompleter
Diffstat (limited to 'searx/poolrequests.py')
-rw-r--r-- | searx/poolrequests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/poolrequests.py b/searx/poolrequests.py index 933e0ad93..f9a9d7719 100644 --- a/searx/poolrequests.py +++ b/searx/poolrequests.py @@ -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 |