fix: 已删除设备残留失败记录不再出现在异常汇总
- _merge_status 清理不在 STF 设备池且无运行 worker 的陈旧状态 - /api/summary 按当前设备池过滤,STF 异常时不隐藏任何记录
This commit is contained in:
@@ -723,6 +723,16 @@ class TaskManager:
|
||||
worker_status = {w["serial"]: w for w in get_all_worker_status()}
|
||||
running = self.get_running()
|
||||
|
||||
# 清理陈旧状态:serial 已不在 STF 设备池、且没有在跑 worker 的条目,
|
||||
# 避免设备被删除后其失败记录仍残留在"异常汇总"里
|
||||
present = {dev.get("serial", "") for dev in all_devices}
|
||||
for serial, w in list(worker_status.items()):
|
||||
if serial in present or serial in running:
|
||||
continue
|
||||
if w.get("status") in ("running", "connecting"):
|
||||
continue
|
||||
_remove_worker(serial)
|
||||
|
||||
result = []
|
||||
for dev in all_devices:
|
||||
serial = dev.get("serial", "")
|
||||
|
||||
Reference in New Issue
Block a user