AstraOS Ver. 1.8.2:
- DC Bots werden nach restart automatisch gestartet
This commit is contained in:
parent
20ddc5c89d
commit
1652392572
|
|
@ -128,12 +128,6 @@ except Exception as e:
|
|||
accounts_collection = None
|
||||
logs_collection = None
|
||||
|
||||
# Autostart-Funktion für Bots im Produktions- und Entwicklungsmodus aufrufen
|
||||
# Die Prüfung `os.environ.get('WERKZEUG_RUN_MAIN') != 'true'` verhindert, dass es im Debug-Modus doppelt ausgeführt wird.
|
||||
if os.environ.get('WERKZEUG_RUN_MAIN') != 'true':
|
||||
with app.app_context():
|
||||
start_bots_on_startup()
|
||||
|
||||
def start_bots_on_startup():
|
||||
if discord_bots_collection is None:
|
||||
print("WARNUNG: Bot-Autostart übersprungen, da keine DB-Verbindung besteht.")
|
||||
|
|
@ -170,6 +164,11 @@ def start_bots_on_startup():
|
|||
except Exception as e:
|
||||
print(f"FEHLER: Bot '{bot_info['name']}' konnte nicht gestartet werden: {e}")
|
||||
|
||||
# Autostart-Funktion für Bots im Produktions- und Entwicklungsmodus aufrufen
|
||||
# Die Prüfung `os.environ.get('WERKZEUG_RUN_MAIN') != 'true'` verhindert, dass es im Debug-Modus doppelt ausgeführt wird.
|
||||
if os.environ.get('WERKZEUG_RUN_MAIN') != 'true':
|
||||
with app.app_context():
|
||||
start_bots_on_startup()
|
||||
|
||||
try:
|
||||
tickets_client = MongoClient(os.environ.get("MONGO_URI"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue