From 19e2207bc218d607872fe587da7b5d990a969a3d Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Tue, 18 Mar 2025 19:29:08 +0100 Subject: [PATCH] Fix --- src/modules/stream_notifications/twitch/webhook.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/stream_notifications/twitch/webhook.py b/src/modules/stream_notifications/twitch/webhook.py index b3df1f3..6e23e17 100644 --- a/src/modules/stream_notifications/twitch/webhook.py +++ b/src/modules/stream_notifications/twitch/webhook.py @@ -1,4 +1,4 @@ -from asyncio import sleep, gather +from asyncio import sleep, gather, wait, FIRST_COMPLETED, create_task import logging from typing import NoReturn, Literal @@ -180,6 +180,14 @@ class TwitchService: streamers = await StreamerConfigRepository.all() + await wait( + [ + create_task(cls._start_for_streamer(streamer)) + for streamer in streamers + ], + return_when=FIRST_COMPLETED + ) + await gather( *[cls._start_for_streamer(streamer) for streamer in streamers] )