mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
[fix] handle empty search requests
This commit is contained in:
parent
2b7f3e28e7
commit
8c05c00762
@ -410,6 +410,7 @@ class Search(object):
|
|||||||
# init vars
|
# init vars
|
||||||
requests = []
|
requests = []
|
||||||
results_queue = Queue()
|
results_queue = Queue()
|
||||||
|
results = {}
|
||||||
suggestions = set()
|
suggestions = set()
|
||||||
answers = set()
|
answers = set()
|
||||||
infoboxes = []
|
infoboxes = []
|
||||||
@ -484,10 +485,11 @@ class Search(object):
|
|||||||
# append request to list
|
# append request to list
|
||||||
requests.append((req, request_params['url'], request_args, selected_engine['name']))
|
requests.append((req, request_params['url'], request_args, selected_engine['name']))
|
||||||
|
|
||||||
|
if not requests:
|
||||||
|
return results, suggestions, answers, infoboxes
|
||||||
# send all search-request
|
# send all search-request
|
||||||
threaded_requests(requests)
|
threaded_requests(requests)
|
||||||
|
|
||||||
results = {}
|
|
||||||
|
|
||||||
while not results_queue.empty():
|
while not results_queue.empty():
|
||||||
engine_name, engine_results = results_queue.get_nowait()
|
engine_name, engine_results = results_queue.get_nowait()
|
||||||
|
Loading…
Reference in New Issue
Block a user