mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-23 23:20:55 +08:00
refactor: 清理 parser worker rag merger 的历史类型问题
This commit is contained in:
@@ -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} 条消息`,
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user