parent
87d48d77e7
commit
311f83375e
23
alive.py
23
alive.py
|
|
@ -5,24 +5,23 @@
|
||||||
import time
|
import time
|
||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
from dotenv import load_dotenv
|
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')
|
load_dotenv('config.env')
|
||||||
|
|
||||||
try:
|
BASE_URL = os.environ.get('BASE_URL_OF_BOT', None)
|
||||||
BASE_URL = os.environ.get('BASE_URL_OF_BOT', None)
|
if len(BASE_URL) == 0:
|
||||||
if len(BASE_URL) == 0:
|
|
||||||
BASE_URL = None
|
|
||||||
except KeyError:
|
|
||||||
BASE_URL = None
|
BASE_URL = None
|
||||||
|
|
||||||
try:
|
IS_VPS = os.environ.get('IS_VPS', 'False')
|
||||||
IS_VPS = os.environ.get('IS_VPS', 'False')
|
if IS_VPS.lower() == 'true':
|
||||||
if IS_VPS.lower() == 'true':
|
IS_VPS = True
|
||||||
IS_VPS = True
|
else:
|
||||||
else:
|
|
||||||
IS_VPS = False
|
|
||||||
except KeyError:
|
|
||||||
IS_VPS = False
|
IS_VPS = False
|
||||||
|
|
||||||
if not IS_VPS and BASE_URL is not None:
|
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__)
|
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')
|
load_dotenv('config.env')
|
||||||
|
|
||||||
Interval = []
|
Interval = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue