mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-25 23:59:58 +08:00
localcache
This commit is contained in:
parent
1ea5fe04f1
commit
28292be37d
4
pkg/common/db/cache/black.go
vendored
4
pkg/common/db/cache/black.go
vendored
@ -57,8 +57,8 @@ func NewBlackCacheRedis(
|
|||||||
rcClient := rockscache.NewClient(rdb, options)
|
rcClient := rockscache.NewClient(rdb, options)
|
||||||
mc := NewMetaCacheRedis(rcClient)
|
mc := NewMetaCacheRedis(rcClient)
|
||||||
f := config.Config.LocalCache.Friend
|
f := config.Config.LocalCache.Friend
|
||||||
log.ZDebug(context.Background(), "local cache init", "Topic", f.Topic, "SlotNum", f.SlotNum, "SlotSize", f.SlotSize)
|
log.ZDebug(context.Background(), "black local cache init", "Topic", f.Topic, "SlotNum", f.SlotNum, "SlotSize", f.SlotSize)
|
||||||
mc.SetTopic(config.Config.LocalCache.Friend.Topic)
|
mc.SetTopic(f.Topic)
|
||||||
mc.SetRawRedisClient(rdb)
|
mc.SetRawRedisClient(rdb)
|
||||||
return &BlackCacheRedis{
|
return &BlackCacheRedis{
|
||||||
expireTime: blackExpireTime,
|
expireTime: blackExpireTime,
|
||||||
|
5
pkg/common/db/cache/friend.go
vendored
5
pkg/common/db/cache/friend.go
vendored
@ -16,6 +16,7 @@ package cache
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"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/cachekey"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||||
"time"
|
"time"
|
||||||
@ -63,7 +64,9 @@ func NewFriendCacheRedis(rdb redis.UniversalClient, friendDB relationtb.FriendMo
|
|||||||
options rockscache.Options) FriendCache {
|
options rockscache.Options) FriendCache {
|
||||||
rcClient := rockscache.NewClient(rdb, options)
|
rcClient := rockscache.NewClient(rdb, options)
|
||||||
mc := NewMetaCacheRedis(rcClient)
|
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)
|
mc.SetRawRedisClient(rdb)
|
||||||
return &FriendCacheRedis{
|
return &FriendCacheRedis{
|
||||||
metaCache: mc,
|
metaCache: mc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user