diff options
author | Alexandre Flament <alex@al-f.net> | 2021-05-05 13:08:54 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-05-05 13:12:42 +0200 |
commit | 8c1a65d32fb6a0859c0052d668d01f08325f11ad (patch) | |
tree | 8837e952d67fb8a4755ce2c732ada76474da75c2 /searx/engines/__init__.py | |
parent | d36adfa59f242a8775ad74245c696d62b7727a36 (diff) | |
download | searxng-8c1a65d32fb6a0859c0052d668d01f08325f11ad.tar.gz searxng-8c1a65d32fb6a0859c0052d668d01f08325f11ad.zip |
[mod] multithreading only in searx.search.* packages
it prepares the new architecture change,
everything about multithreading in moved in the searx.search.* packages
previously the call to the "init" function of the engines was done in searx.engines:
* the network was not set (request not sent using the defined proxy)
* it requires to monkey patch the code to avoid HTTP requests during the tests
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r-- | searx/engines/__init__.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 6c3ac7a42..15212afd9 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -167,26 +167,3 @@ def load_engines(engine_list): if engine is not None: engines[engine.name] = engine return engines - - -def initialize_engines(engine_list): - load_engines(engine_list) - initialize_network(engine_list, settings['outgoing']) - - def engine_init(engine_name, init_fn): - try: - set_context_network_name(engine_name) - init_fn(get_engine_from_settings(engine_name)) - except SearxEngineResponseException as exc: - logger.warn('%s engine: Fail to initialize // %s', engine_name, exc) - except Exception: - logger.exception('%s engine: Fail to initialize', engine_name) - else: - logger.debug('%s engine: Initialized', engine_name) - - for engine_name, engine in engines.items(): - if hasattr(engine, 'init'): - init_fn = getattr(engine, 'init') - if init_fn: - logger.debug('%s engine: Starting background initialization', engine_name) - threading.Thread(target=engine_init, args=(engine_name, init_fn)).start() |