fix: remove traced_faces directory check in Worker

問題:
- Worker 檢查 traced_faces/ 目錄是否存在
- Python store_traced_faces.py 不創建此目錄
- 導致無限重試

修復:
- 只檢查 face_traced.json 是否存在
- 移除 traced_faces/ 目錄檢查

影響:
- ✅ Worker 不再無限重試
- ✅ 支持 Rust store_traced_faces
- ✅ 支持 Python store_traced_faces

驗證:
- Worker 將在下次 Pipeline 運行時使用新邏輯
This commit is contained in:
Accusys
2026-09-28 10:40:30 +08:00
parent e38705e7d2
commit f15842e9cf
+2 -29
View File
@@ -2817,36 +2817,9 @@ impl JobWorker {
uuid
);
// ✅ V2: Check data integrity, not just file existence
let traced_dir = format!(
"{}/{}/traced_faces/",
crate::core::config::OUTPUT_DIR
.as_str()
.trim_end_matches('/'),
uuid
);
let trace_complete = if std::path::Path::new(&traced_path).exists() {
// Check if traced_faces/ directory exists and has files
if std::path::Path::new(&traced_dir).exists() {
if let Ok(entries) = std::fs::read_dir(&traced_dir) {
let file_count = entries.count();
if file_count > 0 {
info!("✅ Face trace already done for {}, {} files in traced_faces/", uuid, file_count);
true
} else {
warn!("⚠️ Face trace incomplete for {}: traced_faces/ is empty, re-running", uuid);
let _ = std::fs::remove_file(&traced_path);
false
}
} else {
warn!("⚠️ Face trace incomplete for {}: cannot read traced_faces/, re-running", uuid);
let _ = std::fs::remove_file(&traced_path);
false
}
} else {
warn!("⚠️ Face trace incomplete for {}: traced_faces/ not found, re-running", uuid);
let _ = std::fs::remove_file(&traced_path);
false
}
info!("✅ Face trace already done for {} (face_traced.json exists)", uuid);
true
} else {
false
};