From 2ef3148d4634f6e5becfd20e06fac4033696a8c4 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Mon, 21 Apr 2025 23:58:08 +0200 Subject: [PATCH] Fix --- src/applications/schedule_sync/workflows/sync.py | 3 ++- .../twitch_webhook/workflows/on_channel_update.py | 5 +++-- src/applications/twitch_webhook/workflows/on_message.py | 3 +++ .../twitch_webhook/workflows/on_reward_redemption.py | 5 ++++- .../twitch_webhook/workflows/on_stream_online.py | 5 ++++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/applications/schedule_sync/workflows/sync.py b/src/applications/schedule_sync/workflows/sync.py index f6eaf7d..a0fe9c5 100644 --- a/src/applications/schedule_sync/workflows/sync.py +++ b/src/applications/schedule_sync/workflows/sync.py @@ -35,5 +35,6 @@ class ScheduleSyncWorkflow: await workflow.start_activity( syncronize, - streamer.twitch.id + streamer.twitch.id, + schedule_to_close_timeout=timedelta(minutes=5), ) diff --git a/src/applications/twitch_webhook/workflows/on_channel_update.py b/src/applications/twitch_webhook/workflows/on_channel_update.py index f51dc55..b8271b3 100644 --- a/src/applications/twitch_webhook/workflows/on_channel_update.py +++ b/src/applications/twitch_webhook/workflows/on_channel_update.py @@ -1,4 +1,4 @@ -from datetime import datetime, timezone +from datetime import datetime, timezone, timedelta from temporalio import workflow @@ -33,5 +33,6 @@ class OnChannelUpdateWorkflow: category=event.category_name, last_live_at=datetime.now(timezone.utc) ), - ) + ), + schedule_to_close_timeout=timedelta(minutes=1) ) diff --git a/src/applications/twitch_webhook/workflows/on_message.py b/src/applications/twitch_webhook/workflows/on_message.py index 0f7ade2..108f2a2 100644 --- a/src/applications/twitch_webhook/workflows/on_message.py +++ b/src/applications/twitch_webhook/workflows/on_message.py @@ -1,3 +1,5 @@ +from datetime import timedelta + from temporalio import workflow from applications.twitch_webhook.messages_proc import MessageEvent @@ -13,4 +15,5 @@ class OnMessageWorkflow: on_message_activity, message, task_queue=MAIN_QUEUE, + schedule_to_close_timeout=timedelta(minutes=1) ) diff --git a/src/applications/twitch_webhook/workflows/on_reward_redemption.py b/src/applications/twitch_webhook/workflows/on_reward_redemption.py index 3255897..2ba6a33 100644 --- a/src/applications/twitch_webhook/workflows/on_reward_redemption.py +++ b/src/applications/twitch_webhook/workflows/on_reward_redemption.py @@ -1,3 +1,5 @@ +from datetime import timedelta + from temporalio import workflow from applications.twitch_webhook.activities.redemption_reward import on_redemption_reward_add_activity @@ -12,5 +14,6 @@ class OnRewardRedemptionWorkflow: await workflow.start_activity( on_redemption_reward_add_activity, reward, - task_queue=MAIN_QUEUE + task_queue=MAIN_QUEUE, + schedule_to_close_timeout=timedelta(minutes=1) ) diff --git a/src/applications/twitch_webhook/workflows/on_stream_online.py b/src/applications/twitch_webhook/workflows/on_stream_online.py index 6f14fc4..6575c17 100644 --- a/src/applications/twitch_webhook/workflows/on_stream_online.py +++ b/src/applications/twitch_webhook/workflows/on_stream_online.py @@ -1,3 +1,5 @@ +from datetime import timedelta + from temporalio import workflow from applications.twitch_webhook.activities.on_state_change import on_stream_state_change_activity, OnStreamStateChangeActivity @@ -15,5 +17,6 @@ class OnStreamOnlineWorkflow: streamer_id=int(broadcaster_user_id), event_type=event_type ), - task_queue=MAIN_QUEUE + task_queue=MAIN_QUEUE, + schedule_to_close_timeout=timedelta(minutes=1) )