mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 07:05:36 +01:00
Fix
This commit is contained in:
@@ -8,6 +8,9 @@ from temporalio.worker import Worker, UnsandboxedWorkflowRunner
|
||||
from applications.schedule_sync import activities as schedule_sync_activities
|
||||
from applications.schedule_sync.workflows import ScheduleSyncWorkflow
|
||||
|
||||
from applications.twitch_webhook import activities as twitch_activities
|
||||
from applications.twitch_webhook import workflows as twitch_workflows
|
||||
|
||||
from .queues import MAIN_QUEUE
|
||||
|
||||
|
||||
@@ -20,14 +23,29 @@ async def main():
|
||||
except ScheduleAlreadyRunningError:
|
||||
pass
|
||||
|
||||
for id, schedule in twitch_workflows.StreamsCheckWorkflow.get_schedules().items():
|
||||
try:
|
||||
await client.create_schedule(f"StreamsCheckWorkflow-{id}", schedule)
|
||||
except ScheduleAlreadyRunningError:
|
||||
pass
|
||||
|
||||
worker: Worker = Worker(
|
||||
client,
|
||||
task_queue=MAIN_QUEUE,
|
||||
workflows=[
|
||||
ScheduleSyncWorkflow
|
||||
ScheduleSyncWorkflow,
|
||||
twitch_workflows.StreamsCheckWorkflow,
|
||||
twitch_workflows.OnChannelUpdateWorkflow,
|
||||
twitch_workflows.OnMessageWorkflow,
|
||||
twitch_workflows.OnRewardRedemptionWorkflow,
|
||||
twitch_workflows.OnStreamOnlineWorkflow,
|
||||
],
|
||||
activities=[
|
||||
schedule_sync_activities.syncronize,
|
||||
twitch_activities.on_message_activity,
|
||||
twitch_activities.on_stream_state_change_activity,
|
||||
twitch_activities.check_streams_states,
|
||||
twitch_activities.on_redemption_reward_add_activity,
|
||||
],
|
||||
workflow_runner=UnsandboxedWorkflowRunner(),
|
||||
)
|
||||
|
||||
12
src/applications/twitch_webhook/activities/__init__.py
Normal file
12
src/applications/twitch_webhook/activities/__init__.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from .message_proc import on_message_activity
|
||||
from .on_state_change import on_stream_state_change_activity
|
||||
from .redemption_reward import on_redemption_reward_add_activity
|
||||
from .state_checker import check_streams_states
|
||||
|
||||
|
||||
__all__ = [
|
||||
"on_message_activity",
|
||||
"on_stream_state_change_activity",
|
||||
"check_streams_states",
|
||||
"on_redemption_reward_add_activity",
|
||||
]
|
||||
14
src/applications/twitch_webhook/workflows/__init__.py
Normal file
14
src/applications/twitch_webhook/workflows/__init__.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from .checker import StreamsCheckWorkflow
|
||||
from .on_channel_update import OnChannelUpdateWorkflow
|
||||
from .on_message import OnMessageWorkflow
|
||||
from .on_reward_redemption import OnRewardRedemptionWorkflow
|
||||
from .on_stream_online import OnStreamOnlineWorkflow
|
||||
|
||||
|
||||
__all__ = [
|
||||
"StreamsCheckWorkflow",
|
||||
"OnChannelUpdateWorkflow",
|
||||
"OnMessageWorkflow",
|
||||
"OnRewardRedemptionWorkflow",
|
||||
"OnStreamOnlineWorkflow",
|
||||
]
|
||||
Reference in New Issue
Block a user