summaryrefslogtreecommitdiff
path: root/searx/search
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-09-23 11:31:29 +0200
committerAlexandre Flament <alex@al-f.net>2021-10-12 21:01:02 +0200
commitf9c6393502ece3a678e530ca787efe2ea22b51d7 (patch)
tree441777b67955178752d41f1496fcec1ac5877eba /searx/search
parent4cc1ee8565e22442ae92ed5f2015749d684e6087 (diff)
downloadsearxng-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__.py6
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: