refactor: 清理 parser worker rag merger 的历史类型问题

This commit is contained in:
digua
2026-03-25 22:43:12 +08:00
parent b6fdc3887e
commit 7eaba396ec
29 changed files with 264 additions and 103 deletions
@@ -227,6 +227,9 @@ export async function incrementalImport(
if (processedCount % BATCH_SIZE === 0) {
sendProgress(requestId, {
stage: 'saving',
bytesRead: 0,
totalBytes: 0,
messagesProcessed: processedCount,
percentage: 50, // 实际进度难以计算,使用固定值
message: `已处理 ${processedCount} 条,新增 ${newMessageCount}`,
})
@@ -244,6 +247,9 @@ export async function incrementalImport(
sendProgress(requestId, {
stage: 'done',
bytesRead: 0,
totalBytes: 0,
messagesProcessed: processedCount,
percentage: 100,
message: `导入完成,新增 ${newMessageCount} 条消息`,
})
+2 -1
View File
@@ -17,6 +17,7 @@ import {
type ParsedMessage,
type FormatFeature,
} from '../../parser'
import { ChatType } from '../../../../src/types/base'
import { getDbDir } from '../core'
import {
initPerfLog,
@@ -876,7 +877,7 @@ export async function streamParseFileInfo(filePath: string, requestId: string):
VALUES (?, ?, ?, ?, ?, ?)
`)
let meta: ParsedMeta = { name: '未知群聊', platform: formatFeature.platform, type: 'group' }
let meta: ParsedMeta = { name: '未知群聊', platform: formatFeature.platform, type: ChatType.GROUP }
const memberSet = new Set<string>()
let messageCount = 0
let metaInserted = false