diff --git a/config.py b/config.py index c53bba3..0cc8ce3 100644 --- a/config.py +++ b/config.py @@ -14,4 +14,6 @@ model_cache_db_path = os.getenv('CACHE_PATH', 'squads_stat_cache.sqlite3') sqlite_db_path = os.getenv('SQLITE_DB_PATH', 'squads_stat.sqlite3') -log_level = os.getenv('LOG_LEVEL', 'DEBUG').upper() \ No newline at end of file +log_level = os.getenv('LOG_LEVEL', 'DEBUG').upper() + +time_between_requests = os.getenv("TIME_BETWEEN_REQUESTS") diff --git a/utils.py b/utils.py index a14cf29..ece1304 100644 --- a/utils.py +++ b/utils.py @@ -5,15 +5,15 @@ import enum import falcon import requests - +import config from EDMCLogging import get_main_logger logger = get_main_logger() TIME_BETWEEN_REQUESTS: float = 3.0 -if os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS") is not None: +if config.time_between_requests is not None: try: - TIME_BETWEEN_REQUESTS = float(os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS")) + TIME_BETWEEN_REQUESTS = float(config.time_between_requests) except TypeError: # env doesn't contain a float pass