Fix event loop #32

Merged
Berack96 merged 2 commits from fix-asyncio-loop into main 2025-10-13 22:34:28 +02:00
Showing only changes of commit 7840da24ce - Show all commits

View File

@@ -24,7 +24,9 @@ if __name__ == "__main__":
except AssertionError as e: except AssertionError as e:
try: try:
logging.warning(f"Telegram bot could not be started: {e}") logging.warning(f"Telegram bot could not be started: {e}")
asyncio.get_event_loop().run_forever() loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_forever()
except KeyboardInterrupt: except KeyboardInterrupt:
logging.info("Shutting down due to KeyboardInterrupt") logging.info("Shutting down due to KeyboardInterrupt")
finally: finally: