diff --git a/api/core/workflow/workflow_cycle_manager.py b/api/core/workflow/workflow_cycle_manager.py index aeeb96517..503273f56 100644 --- a/api/core/workflow/workflow_cycle_manager.py +++ b/api/core/workflow/workflow_cycle_manager.py @@ -36,6 +36,7 @@ from tasks.extend.update_account_money_when_workflow_node_execution_created_exte update_account_money_when_workflow_node_execution_created_extend, ) + # 二开部分End - 密钥额度限制 @dataclass @@ -199,6 +200,11 @@ class WorkflowCycleManager: # 二开部分Begin - 额度限制 # 异步任务计算费用并更新账户额度,将对象转换为字典传递 domain_execution_dict = jsonable_encoder(domain_execution) + + # 添加用户信息到字典中 + domain_execution_dict['created_by'] = self._application_generate_entity.user_id + domain_execution_dict['created_by_role'] = 'account' # 工作流通常由账户用户调用 + update_account_money_when_workflow_node_execution_created_extend.delay(domain_execution_dict) # 二开部分End - 额度限制 return domain_execution @@ -207,9 +213,9 @@ class WorkflowCycleManager: self, *, event: QueueNodeFailedEvent - | QueueNodeInIterationFailedEvent - | QueueNodeInLoopFailedEvent - | QueueNodeExceptionEvent, + | QueueNodeInIterationFailedEvent + | QueueNodeInLoopFailedEvent + | QueueNodeExceptionEvent, ) -> WorkflowNodeExecution: """ Workflow node execution failed @@ -353,7 +359,7 @@ class WorkflowCycleManager: node_exec for node_exec in self._node_execution_cache.values() if node_exec.workflow_execution_id == workflow_execution_id - and node_exec.status == WorkflowNodeExecutionStatus.RUNNING + and node_exec.status == WorkflowNodeExecutionStatus.RUNNING ] for node_execution in running_node_executions: diff --git a/docker/docker-compose.dify-plus.yaml b/docker/docker-compose.dify-plus.yaml index 3e98e8844..6ad9a8301 100644 --- a/docker/docker-compose.dify-plus.yaml +++ b/docker/docker-compose.dify-plus.yaml @@ -816,7 +816,7 @@ services: # plugin daemon plugin_daemon: - image: langgenius/dify-plugin-daemon:0.2.0-local + image: ccr.ccs.tencentyun.com/yfgaia/dify-plugin-daemon:0.2.0-local restart: always environment: # Use the shared environment variables.