From ab60afc018786e24978c6e119ba755848ea72916 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 2 Sep 2026 18:02:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20diagnose=5Fbid=5Fproject=E8=A1=A5paused?= =?UTF-8?q?=E9=97=A8=E7=A6=81=E2=80=94=E2=80=94=E9=9D=9Ein=5Fprogress?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8F=AA=E8=AF=8A=E6=96=AD=E4=B8=8D=E6=B4=BE?= =?UTF-8?q?=E5=8F=91(9/2=E8=AF=8A=E6=96=AD=E5=85=A5=E5=8F=A3=E7=BB=95?= =?UTF-8?q?=E8=BF=87=E6=9A=82=E5=81=9C=E6=B4=BE=E5=8F=91=E8=BF=9D=E5=8F=8D?= =?UTF-8?q?=E9=9B=B6=E6=B6=88=E8=80=97=E9=93=81=E5=BE=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_bidding/bid_flow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pipeline_bidding/bid_flow.py b/pipeline_bidding/bid_flow.py index 84d95f4..b3e395a 100644 --- a/pipeline_bidding/bid_flow.py +++ b/pipeline_bidding/bid_flow.py @@ -717,6 +717,9 @@ async def diagnose_bid_project(project_id): if not prec: return "项目不存在: %s" % project_id proj = rec_to_dict(prec[0]) + # 门禁:非 in_progress 的项目只诊断不派发(2026-09-02:诊断入口曾绕过 + # paused 排除派发任务,违反"项目 paused 零消耗"铁律) + _proj_paused = proj.get("status") not in ("in_progress", "active", "running") hts = await sor.sqlExe( "SELECT id, task_type, title, status FROM pipeline_human_tasks " "WHERE project_id=${p}$ ORDER BY created_at DESC LIMIT 20", {"p": project_id}) @@ -740,7 +743,9 @@ async def diagnose_bid_project(project_id): counts[tbl] = await _count( sor, "SELECT COUNT(*) AS c FROM " + tbl + " WHERE project_id=${p}$", {"p": project_id}) - acts = await reconcile_project(sor, project_id, proj.get("name", "")) + acts = (["skipped: 项目状态 %s(非 in_progress),只诊断不派发" % proj.get("status")] + if _proj_paused + else await reconcile_project(sor, project_id, proj.get("name", ""))) return json.dumps({ "project": proj, "counts": counts, "chapter_status": {getattr(r, "status", ""): to_int(getattr(r, "c", 0))