From: Roland Häder Date: Wed, 12 Jul 2023 09:20:12 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ad58f3fad6c51473a2c217d3303cb1ee82c5ac0f;p=fba.git Continued: - don't let the user set something higher (- 50) than system allows --- 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)