diff --git a/src/worker/job_worker.rs b/src/worker/job_worker.rs index 1a4c3076..1d45eafa 100644 --- a/src/worker/job_worker.rs +++ b/src/worker/job_worker.rs @@ -4124,7 +4124,27 @@ async fn process_job(&self, job: crate::core::db::MonitorJob) -> Result<()> { if trace_complete { info!("✅ Face trace already done for {}, skipping spawn", uuid); - + + // Keep videos.processing_status JSON in sync: mark FACE_TRACE + // completed with full frame count. Without this, the UI shows + // FACE_TRACE stuck at running/0 while FACE_CLUSTER is completed + // (which looks like a broken dependency). + let tf = self + .db + .get_video_by_uuid(uuid) + .await + .ok() + .flatten() + .map(|v| v.total_frames as u64) + .unwrap_or(0); + if let Err(e) = self + .db + .update_processor_progress(uuid, "face_trace", tf, tf, "completed") + .await + { + warn!("[FACE_TRACE] failed to mark progress completed for {}: {}", uuid, e); + } + // ✅ Ensure processor_results record exists for dependency checks let mut success = false; for attempt in 1..=3 { @@ -4420,6 +4440,27 @@ async fn process_job(&self, job: crate::core::db::MonitorJob) -> Result<()> { &pp, ) .await; + + // Sync videos.processing_status JSON (UI source of truth) + let tf = db_clone + .get_video_by_uuid(&uuid_clone) + .await + .ok() + .flatten() + .map(|v| v.total_frames as u64) + .unwrap_or(0); + if let Err(e) = db_clone + .update_processor_progress( + &uuid_clone, + "face_trace", + tf, + tf, + "completed", + ) + .await + { + warn!("[FACE_TRACE] failed to mark progress completed for {}: {}", uuid_clone, e); + } } Err(e) => { error!(