mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 11:04:51 +00:00
Update vars.py
This commit is contained in:
parent
2bb80308b1
commit
8a78081738
1 changed files with 4 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import sys
|
import sys, requests
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from os import environ
|
from os import environ
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
@ -8,14 +8,14 @@ LOGGER = getLogger(__name__)
|
||||||
CONFIG_FILE_URL = environ.get("CONFIG_FILE_URL", "")
|
CONFIG_FILE_URL = environ.get("CONFIG_FILE_URL", "")
|
||||||
if len(CONFIG_FILE_URL) != 0:
|
if len(CONFIG_FILE_URL) != 0:
|
||||||
try:
|
try:
|
||||||
res = get(CONFIG_FILE_URL)
|
res = requests.get(CONFIG_FILE_URL)
|
||||||
if res.status_code == 200:
|
if res.status_code == 200:
|
||||||
with open("config.env", "wb+") as f:
|
with open("config.env", "wb+") as f:
|
||||||
f.write(res.content)
|
f.write(res.content)
|
||||||
else:
|
else:
|
||||||
logging.error(f"Failed to download config.env {res.status_code}")
|
LOGGER.error(f"Failed to download config.env {res.status_code}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"CONFIG_FILE_URL: {e}")
|
LOGGER.error(f"CONFIG_FILE_URL: {e}")
|
||||||
|
|
||||||
load_dotenv("config.env", override=True)
|
load_dotenv("config.env", override=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue