feat: 调整日志

This commit is contained in:
李如威 2025-09-23 17:42:31 +08:00
parent a168940b33
commit ceee156e65
1 changed files with 17 additions and 1 deletions

View File

@ -253,7 +253,23 @@ def create_app():
app.state.task_nodes.pop(task_id, None)
# 更新日志
work_log.result = shared
work_log_result = []
for x in nodes:
id = x.id
node_info = node_dict[id]
shared_info = shared.get(id)
status = ""
if shared_info and shared_info.get("err"):
status = "error"
elif shared_info:
status = "success"
work_log_result.append({
"id": id,
"title": node_info.get("title", ""),
"result": shared.get(id, {}),
"status": status
})
work_log.result = work_log_result
if next((x for x in shared.values() if x.get("err")), None):
work_log.status = DB.WorkLogsStatus.FAILED
else: