summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
authorAdam Tauber <adam.tauber@balabit.com>2014-12-19 13:59:41 +0100
committerAdam Tauber <adam.tauber@balabit.com>2014-12-19 13:59:41 +0100
commit2b7f3e28e716f74dd8ed1613ee9bd20492daacee (patch)
tree9c0ec4ea592d90f41f8616f381a92901ec0b89c3 /searx/search.py
parent789e46f1c8fc7ef705b0d3e9953688eacba8beaf (diff)
[mod] display timeoutted engine name
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/searx/search.py b/searx/search.py
index 064f37220..fd5bfcde5 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -37,7 +37,7 @@ number_of_searches = 0
def threaded_requests(requests):
timeout_limit = max(r[2]['timeout'] for r in requests)
search_start = time()
- for fn, url, request_args in requests:
+ for fn, url, request_args, engine_name in requests:
request_args['timeout'] = timeout_limit
th = threading.Thread(
target=fn,
@@ -45,6 +45,7 @@ def threaded_requests(requests):
kwargs=request_args,
name='search_request',
)
+ th._engine_name = engine_name
th.start()
for th in threading.enumerate():
@@ -52,7 +53,7 @@ def threaded_requests(requests):
remaining_time = max(0.0, timeout_limit - (time() - search_start))
th.join(remaining_time)
if th.isAlive():
- print('engine timeout')
+ print('engine timeout: {0}'.format(th._engine_name))
@@ -481,7 +482,7 @@ class Search(object):
continue
# append request to list
- requests.append((req, request_params['url'], request_args))
+ requests.append((req, request_params['url'], request_args, selected_engine['name']))
# send all search-request
threaded_requests(requests)