mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-06-06 15:11:51 +00:00
优化api性能
This commit is contained in:
@@ -606,7 +606,7 @@ class MessagePushService {
|
||||
].join(' ')
|
||||
const result = await wcdbService.execQuery('message', table.dbPath, sql)
|
||||
if (!result.success || !Array.isArray(result.rows) || result.rows.length === 0) continue
|
||||
messages.push(...chatService.mapRowsToMessagesForApi(result.rows as Record<string, any>[]))
|
||||
messages.push(...chatService.mapRowsToMessagesForApi(result.rows as Record<string, any>[], sessionId))
|
||||
}
|
||||
|
||||
return messages
|
||||
@@ -630,7 +630,7 @@ class MessagePushService {
|
||||
].join(' ')
|
||||
const result = await wcdbService.execQuery('message', table.dbPath, sql)
|
||||
if (!result.success || !Array.isArray(result.rows) || result.rows.length === 0) continue
|
||||
messages.push(...chatService.mapRowsToMessagesForApi(result.rows as Record<string, any>[]))
|
||||
messages.push(...chatService.mapRowsToMessagesForApi(result.rows as Record<string, any>[], sessionId))
|
||||
}
|
||||
|
||||
return messages.sort((left, right) => this.compareMessagePosition(left, right))
|
||||
@@ -666,7 +666,7 @@ class MessagePushService {
|
||||
].filter(Boolean).join(' ')
|
||||
const result = await wcdbService.execQuery('message', table.dbPath, sql)
|
||||
if (!result.success || !Array.isArray(result.rows) || result.rows.length === 0) continue
|
||||
const [message] = chatService.mapRowsToMessagesForApi(result.rows as Record<string, any>[])
|
||||
const [message] = chatService.mapRowsToMessagesForApi(result.rows as Record<string, any>[], sessionId)
|
||||
if (message && !this.isRevokeSystemMessage(message)) return message
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user