]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/config.py
Continued:
[fba.git] / fba / helpers / config.py
index 8fe1bd6465ad344be98398c73922e4ac367645f9..11ad9762825c9d6338df79ce40c853364a4fd9b5 100644 (file)
@@ -16,6 +16,7 @@
 
 import logging
 import json
+import sys
 
 logging.basicConfig(level=logging.INFO)
 logger = logging.getLogger(__name__)
@@ -23,9 +24,12 @@ 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))
+    logger.debug("LOADED!")
 
 def get(key: str) -> any:
     logger.debug("key[%s]='%s' - CALLED!", type(key), key)
+
     if not isinstance(key, str):
         raise ValueError(f"Parameter key[]='{type(key)}' is not of type 'str'")
     elif key == "":