mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-13 16:49:42 +08:00
fix
This commit is contained in:
@@ -74,7 +74,7 @@ def get_event_types(_: schemas.TokenPayload = Depends(get_current_active_user))
|
||||
获取所有事件类型
|
||||
"""
|
||||
return [{
|
||||
"name": event_type.name,
|
||||
"title": event_type.name,
|
||||
"value": event_type.value
|
||||
} for event_type in EventType]
|
||||
|
||||
|
||||
@@ -83,16 +83,6 @@ class WorkflowExecutor:
|
||||
if self.indegree[action_id] == 0:
|
||||
self.queue.append(action_id)
|
||||
|
||||
@eventmanager.register(EventType.WorkflowExecute)
|
||||
def event_execute(self, event: Event):
|
||||
"""
|
||||
事件触发工作流执行
|
||||
"""
|
||||
workflow_id = event.event_data.get('workflow_id')
|
||||
if not workflow_id:
|
||||
return
|
||||
WorkflowChain.process(workflow_id, from_begin=False)
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
执行工作流
|
||||
@@ -200,6 +190,16 @@ class WorkflowChain(ChainBase):
|
||||
工作流链
|
||||
"""
|
||||
|
||||
@eventmanager.register(EventType.WorkflowExecute)
|
||||
def event_process(self, event: Event):
|
||||
"""
|
||||
事件触发工作流执行
|
||||
"""
|
||||
workflow_id = event.event_data.get('workflow_id')
|
||||
if not workflow_id:
|
||||
return
|
||||
self.process(workflow_id, from_begin=False)
|
||||
|
||||
@staticmethod
|
||||
def process(workflow_id: int, from_begin: Optional[bool] = True) -> Tuple[bool, str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user