diff options
author | Alexandre Flament <alex@al-f.net> | 2021-12-26 22:44:46 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2022-01-05 19:03:04 +0100 |
commit | 2134703b4bb9847d0efeac3b28ceefb7d1f26271 (patch) | |
tree | 054d617ef416a552749cf1cf7761d45f12f348b3 /searx/search | |
parent | a7199bc08552fbd3a8cf8b257aeded5b26591afb (diff) | |
download | searxng-2134703b4bb9847d0efeac3b28ceefb7d1f26271.tar.gz searxng-2134703b4bb9847d0efeac3b28ceefb7d1f26271.zip |
[enh] settings.yml: implement general.enable_metrics
* allow not to record metrics (response time, etc...)
* this commit doesn't change the UI. If the metrics are disabled
/stats and /stats/errors will return empty response.
in /preferences, the columns response time and reliability will be empty.
Diffstat (limited to 'searx/search')
-rw-r--r-- | searx/search/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/search/__init__.py b/searx/search/__init__.py index d66f3362d..e790bd05e 100644 --- a/searx/search/__init__.py +++ b/searx/search/__init__.py @@ -24,13 +24,13 @@ from searx.search.checker import initialize as initialize_checker logger = logger.getChild('search') -def initialize(settings_engines=None, enable_checker=False, check_network=False): +def initialize(settings_engines=None, enable_checker=False, check_network=False, enable_metrics=True): 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_metrics([engine['name'] for engine in settings_engines], enable_metrics) initialize_processors(settings_engines) if enable_checker: initialize_checker() |