From ad58f3fad6c51473a2c217d3303cb1ee82c5ac0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 12 Jul 2023 11:20:12 +0200 Subject: [PATCH] Continued: - don't let the user set something higher (- 50) than system allows --- fba/helpers/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fba/helpers/config.py b/fba/helpers/config.py index 8fe1bd6..6bece6d 100644 --- a/fba/helpers/config.py +++ b/fba/helpers/config.py @@ -16,6 +16,7 @@ import logging import json +import sys logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) @@ -23,6 +24,7 @@ logger = logging.getLogger(__name__) with open("config.json") as f: logger.debug("Loading configuration file ...") _config = json.loads(f.read()) + _config["max_crawl_depth"] = min(_config["max_crawl_depth"], (sys.getrecursionlimit() - 50)) def get(key: str) -> any: logger.debug("key[%s]='%s' - CALLED!", type(key), key) -- 2.39.5