From e39eddab030600298ed8a0010023bb5ad990342d Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Wed, 27 Nov 2024 14:48:44 +0800 Subject: [PATCH] fix: change to use convert_stream_full_response --- .../app/apps/base_app_generate_response_converter.py | 2 +- api/core/app/task_pipeline/workflow_cycle_manage.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/core/app/apps/base_app_generate_response_converter.py b/api/core/app/apps/base_app_generate_response_converter.py index c38e67d577..617116a0bf 100644 --- a/api/core/app/apps/base_app_generate_response_converter.py +++ b/api/core/app/apps/base_app_generate_response_converter.py @@ -22,7 +22,7 @@ class AppGenerateResponseConverter(ABC): else: def _generate_full_response() -> Generator[dict | str, Any, None]: - yield from cls.convert_stream_simple_response(response) + yield from cls.convert_stream_full_response(response) return _generate_full_response() else: diff --git a/api/core/app/task_pipeline/workflow_cycle_manage.py b/api/core/app/task_pipeline/workflow_cycle_manage.py index d45726af46..29f091f6dc 100644 --- a/api/core/app/task_pipeline/workflow_cycle_manage.py +++ b/api/core/app/task_pipeline/workflow_cycle_manage.py @@ -292,9 +292,9 @@ class WorkflowCycleManage: db.session.query(WorkflowNodeExecution).filter(WorkflowNodeExecution.id == workflow_node_execution.id).update( { WorkflowNodeExecution.status: WorkflowNodeExecutionStatus.SUCCEEDED.value, - WorkflowNodeExecution.inputs: json.dumps(inputs) if inputs else None, - WorkflowNodeExecution.process_data: json.dumps(process_data) if event.process_data else None, - WorkflowNodeExecution.outputs: json.dumps(outputs) if outputs else None, + WorkflowNodeExecution.inputs: json.dumps(inputs) if inputs else "{}", + WorkflowNodeExecution.process_data: json.dumps(process_data) if event.process_data else "{}", + WorkflowNodeExecution.outputs: json.dumps(outputs) if outputs else "{}", WorkflowNodeExecution.execution_metadata: execution_metadata, WorkflowNodeExecution.finished_at: finished_at, WorkflowNodeExecution.elapsed_time: elapsed_time, @@ -306,9 +306,9 @@ class WorkflowCycleManage: process_data = WorkflowEntry.handle_special_values(event.process_data) workflow_node_execution.status = WorkflowNodeExecutionStatus.SUCCEEDED.value - workflow_node_execution.inputs = json.dumps(inputs) if inputs else None - workflow_node_execution.process_data = json.dumps(process_data) if process_data else None - workflow_node_execution.outputs = json.dumps(outputs) if outputs else None + workflow_node_execution.inputs = json.dumps(inputs) if inputs else "{}" + workflow_node_execution.process_data = json.dumps(process_data) if process_data else "{}" + workflow_node_execution.outputs = json.dumps(outputs) if outputs else "{}" workflow_node_execution.execution_metadata = execution_metadata workflow_node_execution.finished_at = finished_at workflow_node_execution.elapsed_time = elapsed_time