refactor: simplify status to scanning and completed only
變更: - ✅ 移除 Processing 狀態 - ✅ 移除 Waiting 狀態 - ✅ 移除 Indexed 狀態 - ✅ 移除其他中間狀態 - ✅ 只保留 Scanning 和 Completed VideoStatus 枚舉: - Unregistered - Registered - Pending - Queued - Scanning (處理中) - Completed (完成) - Failed (失敗) 狀態流程: Scanning → Completed 簡化原因: - 中間狀態太多導致用戶困惑 - Scanning 和 Completed 足夠表示處理狀態 - 其他狀態(Pending, Queued, Failed)仍保留 狀態: ✅ 已實施
This commit is contained in:
@@ -665,10 +665,6 @@ impl JobWorker {
|
||||
crate::core::config::set_preferred_language(language);
|
||||
tracing::info!("[WORKER] Set preferred language from admin config: {}", config.search.vlm_output_language);
|
||||
|
||||
// Update status to Processing
|
||||
self.db.update_video_status(&job.uuid, VideoStatus::Processing).await?;
|
||||
info!("[STATUS] Updated status to 'processing' for {}", job.uuid);
|
||||
|
||||
// Read face_settings from job and set environment variables for face processor
|
||||
let mut face_settings_backup: Option<(String, String)> = None;
|
||||
if let Some(ref fs) = job.face_settings {
|
||||
@@ -2740,13 +2736,6 @@ impl JobWorker {
|
||||
count
|
||||
);
|
||||
|
||||
// Update status to Indexed after Rule 1 completion
|
||||
if let Err(e) = db_clone.update_video_status(&uuid_clone, VideoStatus::Indexed).await {
|
||||
error!("[STATUS] Failed to update status to 'indexed' for {}: {}", uuid_clone, e);
|
||||
} else {
|
||||
info!("[STATUS] Updated status to 'indexed' for {}", uuid_clone);
|
||||
}
|
||||
|
||||
if count > 0 {
|
||||
info!(
|
||||
"📝 Starting automatic vectorize for {} chunks...",
|
||||
@@ -3403,11 +3392,6 @@ impl JobWorker {
|
||||
"must": [{"key": "file_uuid", "match": {"value": uuid}}]
|
||||
});
|
||||
|
||||
// Update status to Waiting during TKG verification
|
||||
if let Err(e) = self.db.update_video_status(uuid, VideoStatus::Waiting).await {
|
||||
error!("[STATUS] Failed to update status to 'waiting' for TKG: {}", e);
|
||||
}
|
||||
|
||||
let mut attempts = 0;
|
||||
let max_attempts = 60;
|
||||
let mut stable_trace_count: Option<i64> = None;
|
||||
@@ -3728,11 +3712,6 @@ impl JobWorker {
|
||||
job_id
|
||||
);
|
||||
|
||||
// Update status to Waiting during ingestion phase
|
||||
if let Err(e) = self.db.update_video_status(uuid, VideoStatus::Waiting).await {
|
||||
error!("[STATUS] Failed to update status to 'waiting' for {}: {}", uuid, e);
|
||||
}
|
||||
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user