fix: Face processor now saves status and total_faces to face.json

This commit is contained in:
Accusys
2026-09-26 23:06:11 +08:00
parent 8a736a4103
commit 357e585399
99 changed files with 13881 additions and 1065 deletions
+20 -17
View File
@@ -103,7 +103,11 @@ pub async fn execute_rule3_moment(db: &PostgresDb, file_uuid: &str) -> Result<us
moments.push(window);
if moments.len() % 100 == 0 {
info!("[Rule3-Moment] Processed {}/{} windows", moments.len(), total_windows);
info!(
"[Rule3-Moment] Processed {}/{} windows",
moments.len(),
total_windows
);
}
}
@@ -126,11 +130,7 @@ pub async fn execute_rule3_moment(db: &PostgresDb, file_uuid: &str) -> Result<us
})
.collect();
let trace_ids: Vec<i64> = moment
.selected_traces
.iter()
.map(|t| t.trace_id)
.collect();
let trace_ids: Vec<i64> = moment.selected_traces.iter().map(|t| t.trace_id).collect();
let metadata = serde_json::json!({
"window_index": moment.window_index,
@@ -159,7 +159,10 @@ pub async fn execute_rule3_moment(db: &PostgresDb, file_uuid: &str) -> Result<us
// Store chunk directly (not in tx — store_chunk uses its own tx)
if let Err(e) = db.store_chunk(&chunk).await {
warn!("[Rule3-Moment] Failed to store moment_{}: {}", moment.window_index, e);
warn!(
"[Rule3-Moment] Failed to store moment_{}: {}",
moment.window_index, e
);
} else {
count += 1;
}
@@ -198,13 +201,16 @@ pub async fn execute_rule3_moment(db: &PostgresDb, file_uuid: &str) -> Result<us
if let Err(e) = qdrant
.upsert_vector_to_collection(
&qdrant.collection_name,
moment.window_index as u64,
&vec,
Some(payload),
)
.await
moment.window_index as u64,
&vec,
Some(payload),
)
.await
{
warn!("[Rule3-Moment] Failed to embed moment_{}: {}", moment.window_index, e);
warn!(
"[Rule3-Moment] Failed to embed moment_{}: {}",
moment.window_index, e
);
} else {
embedded += 1;
}
@@ -268,10 +274,7 @@ fn select_key_frames(
}
// Filter traces with valid key_frame
let valid: Vec<&TraceProfileLite> = traces
.iter()
.filter(|t| t.key_frame.is_some())
.collect();
let valid: Vec<&TraceProfileLite> = traces.iter().filter(|t| t.key_frame.is_some()).collect();
if valid.is_empty() {
return MomentWindow {