From e2b3858b6789d9d18197f4f230a5d1ed6acee8b8 Mon Sep 17 00:00:00 2001 From: Accusys Date: Thu, 2 Jul 2026 16:42:24 +0800 Subject: [PATCH] fix: job never completes - processor_results.file_uuid is NULL - ingestion_complete query used file_uuid column which is always NULL - Changed to JOIN processor_results with monitor_jobs on job_id - All stuck jobs now complete successfully --- src/worker/job_worker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/worker/job_worker.rs b/src/worker/job_worker.rs index df3d917..2556d3b 100644 --- a/src/worker/job_worker.rs +++ b/src/worker/job_worker.rs @@ -1096,9 +1096,10 @@ impl JobWorker { let has_face = job_processors.is_empty() || job_processors.iter().any(|p| p == "face"); // Check asr_status for ASR/ASRX - if no_audio_track or silent_audio, ingestion is complete + let mj_t = schema::table_name("monitor_jobs"); let asr_done: bool = if has_asr_or_asrx { let asr_status: Option = sqlx::query_scalar(&format!( - "SELECT asr_status FROM {pr_t} WHERE file_uuid = $1 AND processor IN ('asr', 'asrx') LIMIT 1" + "SELECT asr_status FROM {pr_t} pr JOIN {mj_t} mj ON pr.job_id = mj.id WHERE mj.uuid = $1 AND pr.processor IN ('asr', 'asrx') LIMIT 1" )) .bind(uuid) .fetch_optional(pool)