fix: 添加目录到知识库任意一个失败界面上会展示失败

This commit is contained in:
sijie-chan 2025-02-22 10:55:24 +08:00 committed by 亢奋猫
parent a314aba38f
commit de1999037f

View File

@ -102,8 +102,8 @@ class KnowledgeService {
sendDirectoryProcessingPercent(totalFiles, processedFiles)
return result
})
const loaderResults = await Promise.all(loaderPromises)
const uniqueIds = loaderResults.map((result) => result.uniqueId)
const loaderResults = await Promise.allSettled(loaderPromises)
const uniqueIds = loaderResults.filter(result => result.status === 'fulfilled').map((result) => result.uniqueId)
return {
entriesAdded: loaderResults.length,
uniqueId: `DirectoryLoader_${uuidv4()}`,