Refactor TwitchBot event loop management by replacing get_event_loop with get_running_loop for improved compatibility with asynchronous operations. This change enhances the bot's readiness handling and ensures consistent event loop usage.

This commit is contained in:
2026-03-10 20:11:13 +01:00
parent 399b7c42fd
commit af86ba9a8e
+1 -1
View File
@@ -44,6 +44,7 @@ USER_SCOPE = [
async def _onReady(ready_event: EventData):
logging.info('Bot Twitch prêt')
twitchBot._loop = asyncio.get_running_loop()
with webapp.app_context():
channel = ConfigurationHelper().getValue('twitch_channel')
webapp.config["BOT_STATUS"]["twitch_connected"] = True
@@ -161,7 +162,6 @@ class TwitchBot():
_loop = None
async def _connect(self):
self._loop = asyncio.get_event_loop()
with webapp.app_context():
if _isConfigured():
try: