fix: comprehensive fixes for ingestion and TKG

1. Add Redis PipelineProgress cleanup in unregister_internal
   - Deletes progress key when file is unregistered

2. Fix ingestion_complete asr_status query
   - Query ASRX first, then ASR
   - Filter out NULL values to avoid false negatives

3. Fix TKG 0 nodes/edges support
   - TKG is considered done if face traces are complete
   - TKG may create 0 nodes/edges for videos with minimal content

4. Add ASRX fallback to ASR segments
   - When ASRX has 0 segments but ASR has segments, use ASR segments
   - Ensures at least one ASRX output when ASR has content
This commit is contained in:
Accusys
2026-07-06 21:14:08 +08:00
parent 146d3cedb2
commit 3067896b0f
3 changed files with 67 additions and 18 deletions
+18 -7
View File
@@ -1239,15 +1239,26 @@ async fn unregister(
let deleted_redis_keys = {
match RedisClient::new() {
Ok(redis) => match redis.delete_worker_job(&uuid).await {
Ok(_) => {
tracing::info!("[UNREGISTER] Deleted Redis keys for {}", uuid);
Some(1)
Ok(redis) => {
let mut deleted = 0;
// Delete worker job keys
if redis.delete_worker_job(&uuid).await.is_ok() {
tracing::info!("[UNREGISTER] Deleted Redis worker job keys for {}", uuid);
deleted += 1;
}
Err(e) => {
tracing::warn!("[UNREGISTER] Failed to delete Redis keys: {}", e);
None
// Delete PipelineProgress key
let progress_key = format!("{}progress:{}:pipeline",
crate::core::config::REDIS_KEY_PREFIX.as_str(), uuid);
if let Ok(mut conn) = redis.get_conn().await {
let _: Option<String> = redis::cmd("DEL").arg(&progress_key)
.query_async(&mut conn).await.ok();
tracing::info!("[UNREGISTER] Deleted Redis PipelineProgress for {}", uuid);
deleted += 1;
}
Some(deleted)
},
Err(e) => {
tracing::warn!("[UNREGISTER] Failed to create Redis client: {}", e);