diff options
author | Alexandre Flament <alex@al-f.net> | 2021-12-26 23:09:10 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-12-26 23:09:10 +0100 |
commit | 9215d4cde72edadd763bd212209ead861ed7eebd (patch) | |
tree | f95b5f1b85802793e32cc885ee5e1064d7b36fa2 /searxng_extra | |
parent | 811837d1098b5c09fb2da58cf5a9cf25db41b9e1 (diff) | |
download | searxng-9215d4cde72edadd763bd212209ead861ed7eebd.tar.gz searxng-9215d4cde72edadd763bd212209ead861ed7eebd.zip |
[fix] python searxng_extra/standalone_searx.py --help
The scripts loads the engine and then parse the arguments.
After that the engines are initialized.
Before this commit, with "--help", the HTTP clients are closed before
the engine initialization threads. When these init threads try to send
an HTTP request, an exception is raised.
Diffstat (limited to 'searxng_extra')
-rwxr-xr-x | searxng_extra/standalone_searx.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/searxng_extra/standalone_searx.py b/searxng_extra/standalone_searx.py index e243d9cb1..de8a0d77f 100755 --- a/searxng_extra/standalone_searx.py +++ b/searxng_extra/standalone_searx.py @@ -196,9 +196,14 @@ def parse_argument( if __name__ == '__main__': - searx.search.initialize() + settings_engines = searx.settings['engines'] + searx.search.load_engines(settings_engines) engine_cs = list(searx.engines.categories.keys()) prog_args = parse_argument(category_choices=engine_cs) + searx.search.initialize_network(settings_engines, searx.settings['outgoing']) + searx.search.check_network_configuration() + searx.search.initialize_metrics([engine['name'] for engine in settings_engines]) + searx.search.initialize_processors(settings_engines) search_q = get_search_query(prog_args, engine_categories=engine_cs) res_dict = to_dict(search_q) sys.stdout.write(dumps( |