feat(v0.8.278): refreshSearch cache hit debug logging
Skip invalidate when search cache is still valid and log guild.search refresh cache hit with scope at debug level. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -1318,6 +1318,31 @@ class PearcordPlatform extends EventEmitter {
|
||||
queryLen: String(this._searchQuery || '').length
|
||||
})
|
||||
}
|
||||
const refreshCacheKey = this._searchResolveCacheKeyNow()
|
||||
const refreshGuildId = this.guild.guild.id
|
||||
if (
|
||||
refreshCacheKey === this._searchResolveCacheKey &&
|
||||
this._cachedSearchResults &&
|
||||
this._searchCacheGuildId === refreshGuildId
|
||||
) {
|
||||
this.log.debug('guild.search refresh cache hit', {
|
||||
scope,
|
||||
queryLen: String(this._searchQuery || '').length,
|
||||
count: this._cachedSearchResults.length
|
||||
})
|
||||
if (this._lastSearchMeshMeta) {
|
||||
this._lastSearchMeshMeta = {
|
||||
...this._lastSearchMeshMeta,
|
||||
searchCached: true,
|
||||
refreshing: false
|
||||
}
|
||||
}
|
||||
return {
|
||||
refreshed: true,
|
||||
cached: true,
|
||||
meta: this._lastSearchMeshMeta
|
||||
}
|
||||
}
|
||||
this._invalidateSearchCache()
|
||||
if (this._lastSearchMeshMeta) {
|
||||
this._lastSearchMeshMeta = { ...this._lastSearchMeshMeta, refreshing: true }
|
||||
|
||||
Reference in New Issue
Block a user