Took out env vars reading from utils to config

This commit is contained in:
norohind 2021-11-28 17:25:09 +03:00
parent b056aeba2a
commit 787a03db4f
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
2 changed files with 6 additions and 4 deletions

View File

@ -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()
log_level = os.getenv('LOG_LEVEL', 'DEBUG').upper()
time_between_requests = os.getenv("TIME_BETWEEN_REQUESTS")

View File

@ -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