From 371d8a60a0781e7677e8303c7a60e3d245d025cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zhero=20=26=20=E5=8A=A9=E7=90=86?= Date: Thu, 3 Dec 2026 11:40:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(monitoring):=20=E6=95=B4=E5=BA=93=E8=A2=AB?= =?UTF-8?q?=E9=A1=B6=E6=9B=BF=E7=9A=84=E5=BA=93=E4=B8=8D=E5=86=8D=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=AF=B9=E8=B4=A6=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 概览按 test_kb_id 分组时只对计数加了 superseded 过滤,分组行本身还在, 于是一个已经删掉、8 条发布全被顶替的测试库仍以「0 条」的身份出现, 并继续作为导入对账的候选库。分组前先把历史行排除。 --- internal/monitoring/real.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/monitoring/real.go b/internal/monitoring/real.go index 9d901c4..592d78c 100644 --- a/internal/monitoring/real.go +++ b/internal/monitoring/real.go @@ -161,6 +161,9 @@ FROM test_publications p JOIN source_item_versions version ON version.id=p.source_item_version_id JOIN source_items item ON item.id=version.source_item_id LEFT JOIN removal_candidates removal_candidate ON removal_candidate.publication_id=p.id +-- 整库都被顶替过的 KB 只剩历史行:不排除就仍会占一行「0 条」, +-- 还会出现在导入对账的库下拉里,点下去直接打在已删除的库上。 +WHERE p.superseded_at IS NULL GROUP BY p.test_kb_id ORDER BY p.test_kb_id`) if err != nil {