fix: load pipeline stats in syncFileStatus and handle missing pipeline data

Problem:
- syncFileStatus() doesn't load pipeline progress data
- Files stuck in 'processing' without percentage display
- pollPipelineProgress() not started when pipeline data missing

Solution:
1. Add loadPipelineStats() call in syncFileStatus() for processing files
2. Start pollPipelineProgress() even when pipeline data is missing
3. Ensure progress bar always has data to display

Impact:
- Progress bar now shows percentage during deep scan
- Files no longer stuck in 'processing' state indefinitely
- Better handling of edge cases when API data is missing

Related: Core team needs to verify get_pipeline_stats API accuracy
This commit is contained in:
2026-07-25 01:36:28 +08:00
parent 58e614cb5c
commit c347c200b2
3 changed files with 5 additions and 14 deletions

View File

@@ -886,6 +886,10 @@ export async function syncFileStatus(fileUuid: string): Promise<any> {
delete fileProgressCache.value[fileUuid]
}
f.status = newStatus
if (newStatus === 'processing') {
await loadPipelineStats(fileUuid, true)
}
}
}

View File

@@ -786,7 +786,7 @@ async function loadFiles() {
} else if (pipeline && pipeline.overall_progress >= 1.0) {
f.status = 'completed'
} else if (!pipeline && f.status === 'processing') {
f.status = 'registered'
pollPipelineProgress(f.file_uuid)
}
await loadFileStats(f.file_uuid, true)