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.
This commit is contained in:
Accusys
2026-07-06 13:07:53 +08:00
parent 004ff9ad48
commit e4fdbbc18a

View File

@@ -312,6 +312,12 @@ impl JobWorker {
.init_processing_status(&job.uuid, processor_names.clone(), total_frames) .init_processing_status(&job.uuid, processor_names.clone(), total_frames)
.await?; .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<String> = redis::cmd("DEL").arg(&progress_key).query_async(&mut conn).await.ok();
}
self.db self.db
.update_job_status(job.id, MonitorJobStatus::Running) .update_job_status(job.id, MonitorJobStatus::Running)
.await?; .await?;