From e4fdbbc18a44ef19c91bbb3d50bb4f654784caf6 Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 6 Jul 2026 13:07:53 +0800 Subject: [PATCH] fix: clear stale PipelineProgress when new job starts When a file is re-registered, the old PipelineProgress in Redis was not cleared, causing the Portal to show 'completed' status even though the new job was still running. Now PipelineProgress is deleted when a new job starts processing. --- src/worker/job_worker.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/worker/job_worker.rs b/src/worker/job_worker.rs index 9ba9ff6..c37f8b5 100644 --- a/src/worker/job_worker.rs +++ b/src/worker/job_worker.rs @@ -312,6 +312,12 @@ impl JobWorker { .init_processing_status(&job.uuid, processor_names.clone(), total_frames) .await?; + // Clear any stale PipelineProgress from previous jobs + let progress_key = format!("{}progress:{}:pipeline", crate::core::config::REDIS_KEY_PREFIX.as_str(), job.uuid); + if let Ok(mut conn) = self.redis.get_conn().await { + let _: Option = redis::cmd("DEL").arg(&progress_key).query_async(&mut conn).await.ok(); + } + self.db .update_job_status(job.id, MonitorJobStatus::Running) .await?;