mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2025-04-13 05:17:12 +03:00
Took out env vars reading from utils to config
This commit is contained in:
parent
b056aeba2a
commit
787a03db4f
@ -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")
|
||||
|
6
utils.py
6
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user