fix: 已删除设备残留失败记录不再出现在异常汇总
- _merge_status 清理不在 STF 设备池且无运行 worker 的陈旧状态 - /api/summary 按当前设备池过滤,STF 异常时不隐藏任何记录
This commit is contained in:
@@ -158,6 +158,15 @@ def api_summary():
|
||||
"""
|
||||
try:
|
||||
sts = get_all_worker_status()
|
||||
# 已删除/不在当前 STF 设备池的设备,其陈旧失败记录不应展示。
|
||||
# 复用 get_status 缓存(顺带触发上面的状态清理),STF 异常时不隐藏任何记录。
|
||||
try:
|
||||
devices, derr = mgr.get_status()
|
||||
if not derr:
|
||||
present = {d.get("serial") for d in devices}
|
||||
sts = [s for s in sts if s.get("serial") in present]
|
||||
except Exception:
|
||||
pass
|
||||
counts = {"total": 0, "running": 0, "done": 0,
|
||||
"error": 0, "failed": 0, "idle": 0}
|
||||
errors = []
|
||||
|
||||
Reference in New Issue
Block a user