mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
fix
This commit is contained in:
@@ -74,7 +74,7 @@ def get_event_types(_: schemas.TokenPayload = Depends(get_current_active_user))
|
|||||||
获取所有事件类型
|
获取所有事件类型
|
||||||
"""
|
"""
|
||||||
return [{
|
return [{
|
||||||
"name": event_type.name,
|
"title": event_type.name,
|
||||||
"value": event_type.value
|
"value": event_type.value
|
||||||
} for event_type in EventType]
|
} for event_type in EventType]
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -83,16 +83,6 @@ class WorkflowExecutor:
|
|||||||
if self.indegree[action_id] == 0:
|
if self.indegree[action_id] == 0:
|
||||||
self.queue.append(action_id)
|
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):
|
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
|
@staticmethod
|
||||||
def process(workflow_id: int, from_begin: Optional[bool] = True) -> Tuple[bool, str]:
|
def process(workflow_id: int, from_begin: Optional[bool] = True) -> Tuple[bool, str]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user