mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
fix(export): compute missing stats when stale cache allowed
This commit is contained in:
@@ -5227,8 +5227,8 @@ class ChatService {
|
|||||||
const groupMyMessagesHint = sessionId.endsWith('@chatroom')
|
const groupMyMessagesHint = sessionId.endsWith('@chatroom')
|
||||||
? this.getGroupMyMessageCountHintEntry(sessionId)
|
? this.getGroupMyMessageCountHintEntry(sessionId)
|
||||||
: null
|
: null
|
||||||
|
const cachedResult = this.getSessionStatsCacheEntry(sessionId)
|
||||||
if (!forceRefresh) {
|
if (!forceRefresh) {
|
||||||
const cachedResult = this.getSessionStatsCacheEntry(sessionId)
|
|
||||||
if (cachedResult && this.supportsRequestedRelation(cachedResult.entry, includeRelations)) {
|
if (cachedResult && this.supportsRequestedRelation(cachedResult.entry, includeRelations)) {
|
||||||
const stale = now - cachedResult.entry.updatedAt > this.sessionStatsCacheTtlMs
|
const stale = now - cachedResult.entry.updatedAt > this.sessionStatsCacheTtlMs
|
||||||
if (!stale || allowStaleCache) {
|
if (!stale || allowStaleCache) {
|
||||||
@@ -5248,7 +5248,8 @@ class ChatService {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (allowStaleCache) {
|
// allowStaleCache 仅对“已有缓存”生效;无缓存会话仍需进入计算流程。
|
||||||
|
if (allowStaleCache && cachedResult) {
|
||||||
needsRefreshSet.add(sessionId)
|
needsRefreshSet.add(sessionId)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user