From ffc213fb3d5258dbd0d8b49fd559802801c74d62 Mon Sep 17 00:00:00 2001 From: yangqianqian <5845211314@qq.com> Date: Tue, 16 Jun 2026 12:47:06 +0800 Subject: [PATCH] =?UTF-8?q?B6=20fix:=20error=E4=BA=8B=E4=BB=B6=E5=8F=AA?= =?UTF-8?q?=E5=9C=A8=E9=87=8D=E8=AF=95=E8=80=97=E5=B0=BD=E6=97=B6=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重试中也推error会让前端FatalErrorBanner误报生成失败, 应只在exhausted(彻底失败)时推error事件。 import OK --- backend/app/workers/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/workers/tasks.py b/backend/app/workers/tasks.py index e17097f..c7f16ac 100644 --- a/backend/app/workers/tasks.py +++ b/backend/app/workers/tasks.py @@ -152,8 +152,9 @@ def run_generation_pipeline(self, task_id: int) -> dict: db.commit() except Exception: pass - _push_event_sync(task_id, workspace_id, "error", {"code": 50001, "message": str(exc)}, seq + 1) if exhausted: + # 彻底失败才推 error(前端弹 FatalErrorBanner);重试中不推,避免误报"生成失败"。 + _push_event_sync(task_id, workspace_id, "error", {"code": 50001, "message": str(exc)}, seq + 1) return {"task_id": task_id, "status": "failed", "error": str(exc)} raise self.retry(exc=exc) finally: