mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-20 19:59:11 +08:00
fix: retry node in iteration logs wrong (#11995)
Co-authored-by: Novice Lee <novicelee@NoviPro.local>
This commit is contained in:
parent
c1aa55f3ea
commit
453f324f54
@ -438,6 +438,16 @@ class WorkflowCycleManage:
|
|||||||
elapsed_time = (finished_at - created_at).total_seconds()
|
elapsed_time = (finished_at - created_at).total_seconds()
|
||||||
inputs = WorkflowEntry.handle_special_values(event.inputs)
|
inputs = WorkflowEntry.handle_special_values(event.inputs)
|
||||||
outputs = WorkflowEntry.handle_special_values(event.outputs)
|
outputs = WorkflowEntry.handle_special_values(event.outputs)
|
||||||
|
origin_metadata = {
|
||||||
|
NodeRunMetadataKey.ITERATION_ID: event.in_iteration_id,
|
||||||
|
NodeRunMetadataKey.PARALLEL_MODE_RUN_ID: event.parallel_mode_run_id,
|
||||||
|
}
|
||||||
|
merged_metadata = (
|
||||||
|
{**jsonable_encoder(event.execution_metadata), **origin_metadata}
|
||||||
|
if event.execution_metadata is not None
|
||||||
|
else origin_metadata
|
||||||
|
)
|
||||||
|
execution_metadata = json.dumps(merged_metadata)
|
||||||
|
|
||||||
workflow_node_execution = WorkflowNodeExecution()
|
workflow_node_execution = WorkflowNodeExecution()
|
||||||
workflow_node_execution.tenant_id = workflow_run.tenant_id
|
workflow_node_execution.tenant_id = workflow_run.tenant_id
|
||||||
@ -459,13 +469,7 @@ class WorkflowCycleManage:
|
|||||||
workflow_node_execution.error = event.error
|
workflow_node_execution.error = event.error
|
||||||
workflow_node_execution.inputs = json.dumps(inputs) if inputs else None
|
workflow_node_execution.inputs = json.dumps(inputs) if inputs else None
|
||||||
workflow_node_execution.outputs = json.dumps(outputs) if outputs else None
|
workflow_node_execution.outputs = json.dumps(outputs) if outputs else None
|
||||||
workflow_node_execution.execution_metadata = json.dumps(
|
workflow_node_execution.execution_metadata = execution_metadata
|
||||||
{
|
|
||||||
NodeRunMetadataKey.ITERATION_ID: event.in_iteration_id,
|
|
||||||
NodeRunMetadataKey.PARALLEL_MODE_RUN_ID: event.parallel_mode_run_id,
|
|
||||||
NodeRunMetadataKey.ITERATION_ID: event.in_iteration_id,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
workflow_node_execution.index = event.node_run_index
|
workflow_node_execution.index = event.node_run_index
|
||||||
|
|
||||||
db.session.add(workflow_node_execution)
|
db.session.add(workflow_node_execution)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user