mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 12:10:00 +00:00
[enh] admin configurable suspend time of errored engines - closes #1266
This commit is contained in:
@@ -147,7 +147,8 @@ def search_one_request_safe(engine_name, query, request_params, result_container
|
||||
if requests_exception:
|
||||
# update continuous_errors / suspend_end_time
|
||||
engine.continuous_errors += 1
|
||||
engine.suspend_end_time = time() + min(60, engine.continuous_errors)
|
||||
engine.suspend_end_time = time() + min(settings['search']['max_ban_time_on_fail'],
|
||||
engine.continuous_errors*settings['search']['ban_time_on_fail'])
|
||||
else:
|
||||
# no HTTP error (perhaps an engine error)
|
||||
# anyway, reset the suspend variables
|
||||
|
||||
Reference in New Issue
Block a user