fix: optimize to lru local cache. (#3514)

* fix: optimize to lru  local cache.

* revert lock timing.
This commit is contained in:
Monet Lee
2025-08-14 10:19:11 +08:00
committed by GitHub
parent d542df7000
commit 34971c8b96
5 changed files with 37 additions and 31 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ var (
func NewMsgCache(cache database.Cache, msgDocDatabase database.Msg) cache.MsgCache {
initMemMsgCache.Do(func() {
memMsgCache = lru.NewLayLRU[string, *model.MsgInfoModel](1024*8, time.Hour, time.Second*10, localcache.EmptyTarget{}, nil)
memMsgCache = lru.NewLazyLRU[string, *model.MsgInfoModel](1024*8, time.Hour, time.Second*10, localcache.EmptyTarget{}, nil)
})
return &msgCache{
cache: cache,