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:
@@ -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<String> = redis::cmd("DEL").arg(&progress_key).query_async(&mut conn).await.ok();
|
||||
}
|
||||
|
||||
self.db
|
||||
.update_job_status(job.id, MonitorJobStatus::Running)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user