mirror of
https://github.com/norohind/jubilant-system.git
synced 2025-04-20 16:07:36 +03:00
fix TIME_BETWEEN_REQUESTS as env var
This commit is contained in:
parent
a8007659cd
commit
714106dab2
9
utils.py
9
utils.py
@ -16,7 +16,14 @@ BASE_URL = 'https://api.orerve.net/2.0/website/squadron/'
|
||||
INFO_ENDPOINT = 'info'
|
||||
NEWS_ENDPOINT = 'news/list'
|
||||
|
||||
TIME_BETWEEN_REQUESTS: float = float(os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS")) or 3.0
|
||||
TIME_BETWEEN_REQUESTS: float = 3.0
|
||||
if os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS") is not None:
|
||||
try:
|
||||
TIME_BETWEEN_REQUESTS = float(os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS"))
|
||||
|
||||
except TypeError: # env doesn't contain a float
|
||||
pass
|
||||
|
||||
logger.debug(f'TIME_BETWEEN_REQUESTS = {TIME_BETWEEN_REQUESTS} {type(TIME_BETWEEN_REQUESTS)}')
|
||||
|
||||
with open('available.json', 'r', encoding='utf-8') as available_file:
|
||||
|
Loading…
x
Reference in New Issue
Block a user