From 28292be37d1d6a77db26f6a388cf17eedd296bce Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 10 Jan 2024 12:09:25 +0800 Subject: [PATCH] localcache --- pkg/common/db/cache/black.go | 4 ++-- pkg/common/db/cache/friend.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/common/db/cache/black.go b/pkg/common/db/cache/black.go index 2bb0e7f25..1eb4a6938 100644 --- a/pkg/common/db/cache/black.go +++ b/pkg/common/db/cache/black.go @@ -57,8 +57,8 @@ func NewBlackCacheRedis( rcClient := rockscache.NewClient(rdb, options) mc := NewMetaCacheRedis(rcClient) f := config.Config.LocalCache.Friend - log.ZDebug(context.Background(), "local cache init", "Topic", f.Topic, "SlotNum", f.SlotNum, "SlotSize", f.SlotSize) - mc.SetTopic(config.Config.LocalCache.Friend.Topic) + log.ZDebug(context.Background(), "black local cache init", "Topic", f.Topic, "SlotNum", f.SlotNum, "SlotSize", f.SlotSize) + mc.SetTopic(f.Topic) mc.SetRawRedisClient(rdb) return &BlackCacheRedis{ expireTime: blackExpireTime, diff --git a/pkg/common/db/cache/friend.go b/pkg/common/db/cache/friend.go index e973885de..d39f22271 100644 --- a/pkg/common/db/cache/friend.go +++ b/pkg/common/db/cache/friend.go @@ -16,6 +16,7 @@ package cache import ( "context" + "github.com/OpenIMSDK/tools/log" "github.com/openimsdk/open-im-server/v3/pkg/common/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "time" @@ -63,7 +64,9 @@ func NewFriendCacheRedis(rdb redis.UniversalClient, friendDB relationtb.FriendMo options rockscache.Options) FriendCache { rcClient := rockscache.NewClient(rdb, options) mc := NewMetaCacheRedis(rcClient) - mc.SetTopic(config.Config.LocalCache.Friend.Topic) + f := config.Config.LocalCache.Friend + log.ZDebug(context.Background(), "friend local cache init", "Topic", f.Topic, "SlotNum", f.SlotNum, "SlotSize", f.SlotSize) + mc.SetTopic(f.Topic) mc.SetRawRedisClient(rdb) return &FriendCacheRedis{ metaCache: mc,