mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[mod] refactoring: processors
Report to the user suspended engines. searx.search.processor.abstract: * manages suspend time (per network). * reports suspended time to the ResultContainer (method extend_container_if_suspended) * adds the results to the ResultContainer (method extend_container) * handles exceptions (method handle_exception)
This commit is contained in:
parent
ae5954f2da
commit
aae7830d14
9 changed files with 143 additions and 125 deletions
|
|
@ -106,12 +106,16 @@ class Search:
|
|||
for engineref in self.search_query.engineref_list:
|
||||
processor = processors[engineref.name]
|
||||
|
||||
# stop the request now if the engine is suspend
|
||||
if processor.extend_container_if_suspended(self.result_container):
|
||||
continue
|
||||
|
||||
# set default request parameters
|
||||
request_params = processor.get_params(self.search_query, engineref.category)
|
||||
if request_params is None:
|
||||
continue
|
||||
|
||||
with threading.RLock():
|
||||
with processor.lock:
|
||||
processor.engine.stats['sent_search_count'] += 1
|
||||
|
||||
# append request to list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue