mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
feat:工作流手动中止
This commit is contained in:
@@ -4,6 +4,7 @@ from typing import List, Optional, Union
|
||||
from pydantic import Field
|
||||
|
||||
from app.actions import BaseAction, ActionChain
|
||||
from app.core.config import global_vars
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
@@ -43,11 +44,13 @@ class SendMessageAction(BaseAction):
|
||||
def success(self) -> bool:
|
||||
return self.done
|
||||
|
||||
def execute(self, params: dict, context: ActionContext) -> ActionContext:
|
||||
def execute(self, workflow_id: int, params: dict, context: ActionContext) -> ActionContext:
|
||||
"""
|
||||
发送messages中的消息
|
||||
"""
|
||||
for message in copy.deepcopy(context.messages):
|
||||
if global_vars.is_workflow_stopped(workflow_id):
|
||||
break
|
||||
if params.client:
|
||||
message.source = params.client
|
||||
if params.userid:
|
||||
|
||||
Reference in New Issue
Block a user