diff options
author | Alexandre Flament <alex@al-f.net> | 2021-09-23 11:31:29 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-10-12 21:01:02 +0200 |
commit | f9c6393502ece3a678e530ca787efe2ea22b51d7 (patch) | |
tree | 441777b67955178752d41f1496fcec1ac5877eba /searx/search | |
parent | 4cc1ee8565e22442ae92ed5f2015749d684e6087 (diff) | |
download | searxng-f9c6393502ece3a678e530ca787efe2ea22b51d7.tar.gz searxng-f9c6393502ece3a678e530ca787efe2ea22b51d7.zip |
[enh] verify that Tor proxy works every time searx starts
based on @MarcAbonce commit on searx
Diffstat (limited to 'searx/search')
-rw-r--r-- | searx/search/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/search/__init__.py b/searx/search/__init__.py index 97515622d..0a3c5b3ac 100644 --- a/searx/search/__init__.py +++ b/searx/search/__init__.py @@ -15,7 +15,7 @@ from searx import logger from searx.plugins import plugins from searx.search.models import EngineRef, SearchQuery from searx.engines import load_engines -from searx.network import initialize as initialize_network +from searx.network import initialize as initialize_network, check_network_configuration from searx.metrics import initialize as initialize_metrics, counter_inc, histogram_observe_time from searx.search.processors import PROCESSORS, initialize as initialize_processors from searx.search.checker import initialize as initialize_checker @@ -24,10 +24,12 @@ from searx.search.checker import initialize as initialize_checker logger = logger.getChild('search') -def initialize(settings_engines=None, enable_checker=False): +def initialize(settings_engines=None, enable_checker=False, check_network=False): settings_engines = settings_engines or settings['engines'] load_engines(settings_engines) initialize_network(settings_engines, settings['outgoing']) + if check_network: + check_network_configuration() initialize_metrics([engine['name'] for engine in settings_engines]) initialize_processors(settings_engines) if enable_checker: |