From 0495bf8dbb91d6abf1fb68230e9af2920cc6c777 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Tue, 19 Nov 2024 14:24:19 +0100 Subject: [PATCH] Refactor stream_notifications --- src/modules/stream_notifications/twitch/webhook.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/modules/stream_notifications/twitch/webhook.py b/src/modules/stream_notifications/twitch/webhook.py index 467c245..f21aea6 100644 --- a/src/modules/stream_notifications/twitch/webhook.py +++ b/src/modules/stream_notifications/twitch/webhook.py @@ -104,14 +104,9 @@ class TwitchService: ) logger.info("Twitch service started") - while True: - await sleep(0.1) + await eventsub._keep_loop_alive() finally: - await eventsub.unsubscribe_all() await eventsub.stop() - - await sleep(10) - await self.twitch.close() raise RuntimeError("Twitch service stopped")