parent
87d48d77e7
commit
311f83375e
23
alive.py
23
alive.py
|
|
@ -5,24 +5,23 @@
|
|||
import time
|
||||
import requests
|
||||
import os
|
||||
import subprocess
|
||||
from dotenv import load_dotenv
|
||||
|
||||
CONFIG_FILE_URL = os.environ.get('CONFIG_FILE_URL', None)
|
||||
if CONFIG_FILE_URL is not None:
|
||||
out = subprocess.run(["wget", "-q", "-O", "config.env", CONFIG_FILE_URL])
|
||||
|
||||
load_dotenv('config.env')
|
||||
|
||||
try:
|
||||
BASE_URL = os.environ.get('BASE_URL_OF_BOT', None)
|
||||
if len(BASE_URL) == 0:
|
||||
BASE_URL = None
|
||||
except KeyError:
|
||||
BASE_URL = os.environ.get('BASE_URL_OF_BOT', None)
|
||||
if len(BASE_URL) == 0:
|
||||
BASE_URL = None
|
||||
|
||||
try:
|
||||
IS_VPS = os.environ.get('IS_VPS', 'False')
|
||||
if IS_VPS.lower() == 'true':
|
||||
IS_VPS = True
|
||||
else:
|
||||
IS_VPS = False
|
||||
except KeyError:
|
||||
IS_VPS = os.environ.get('IS_VPS', 'False')
|
||||
if IS_VPS.lower() == 'true':
|
||||
IS_VPS = True
|
||||
else:
|
||||
IS_VPS = False
|
||||
|
||||
if not IS_VPS and BASE_URL is not None:
|
||||
|
|
|
|||
|
|
@ -33,12 +33,6 @@ logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s
|
|||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONFIG_FILE_URL = os.environ.get('CONFIG_FILE_URL', None)
|
||||
if CONFIG_FILE_URL is not None:
|
||||
out = subprocess.run(["wget", "-q", "-O", "config.env", CONFIG_FILE_URL])
|
||||
if out.returncode != 0:
|
||||
logging.error(out)
|
||||
|
||||
load_dotenv('config.env')
|
||||
|
||||
Interval = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue