diff --git a/src/worker/job_worker.rs b/src/worker/job_worker.rs index 49441953..3adb2311 100644 --- a/src/worker/job_worker.rs +++ b/src/worker/job_worker.rs @@ -2485,10 +2485,39 @@ impl JobWorker { uuid, cluster_count, face_track_count ); } else { + // Labels not synced — update tkg_nodes and trace_profiles info!( - "📝 Face dedup running for {}: {} clusters, {} tracks", + "📝 Face dedup running for {}: {} clusters, {} tracks — updating labels", uuid, cluster_count, face_track_count ); + if let Ok(result) = + serde_json::from_value::( + cluster_data.clone() + ) + { + let db_clone = self.db.clone(); + let uuid_clone = uuid.to_string(); + tokio::spawn(async move { + match Self::update_face_track_labels( + &db_clone, + &uuid_clone, + &result, + ) + .await + { + Ok(()) => info!( + "✅ Face dedup labels updated for {}", + uuid_clone + ), + Err(e) => error!( + "❌ Face dedup label update failed for {}: {}", + uuid_clone, e + ), + } + }); + } else { + warn!("Failed to parse face_cluster.json for {}", uuid); + } } } }