This commit is contained in:
wangchuxiao 2023-03-24 18:53:49 +08:00
parent fa477c2d17
commit becbba877a
7 changed files with 8 additions and 8 deletions

View File

@ -46,7 +46,7 @@ func (b *BlackCacheRedis) NewCache() BlackCache {
expireTime: b.expireTime, expireTime: b.expireTime,
rcClient: b.rcClient, rcClient: b.rcClient,
blackDB: b.blackDB, blackDB: b.blackDB,
metaCache: NewMetaCacheRedis(b.rcClient), metaCache: NewMetaCacheRedis(b.rcClient, b.metaCache.GetPreDeleteKeys()...),
} }
} }

View File

@ -68,7 +68,7 @@ func NewNewConversationRedis(rdb redis.UniversalClient, conversationDB *relation
} }
func (c *ConversationRedisCache) NewCache() ConversationCache { func (c *ConversationRedisCache) NewCache() ConversationCache {
return &ConversationRedisCache{rcClient: c.rcClient, metaCache: NewMetaCacheRedis(c.rcClient), conversationDB: c.conversationDB, expireTime: c.expireTime} return &ConversationRedisCache{rcClient: c.rcClient, metaCache: NewMetaCacheRedis(c.rcClient, c.metaCache.GetPreDeleteKeys()...), conversationDB: c.conversationDB, expireTime: c.expireTime}
} }
func (c *ConversationRedisCache) getConversationKey(ownerUserID, conversationID string) string { func (c *ConversationRedisCache) getConversationKey(ownerUserID, conversationID string) string {

View File

@ -40,7 +40,7 @@ func NewExtendMsgSetCacheRedis(rdb redis.UniversalClient, extendMsgSetDB unrelat
func (e *ExtendMsgSetCacheRedis) NewCache() ExtendMsgSetCache { func (e *ExtendMsgSetCacheRedis) NewCache() ExtendMsgSetCache {
return &ExtendMsgSetCacheRedis{ return &ExtendMsgSetCacheRedis{
metaCache: e.metaCache, metaCache: NewMetaCacheRedis(e.rcClient, e.metaCache.GetPreDeleteKeys()...),
expireTime: e.expireTime, expireTime: e.expireTime,
extendMsgSetDB: e.extendMsgSetDB, extendMsgSetDB: e.extendMsgSetDB,
rcClient: e.rcClient, rcClient: e.rcClient,

View File

@ -48,7 +48,7 @@ func NewFriendCacheRedis(rdb redis.UniversalClient, friendDB relationTb.FriendMo
} }
func (c *FriendCacheRedis) NewCache() FriendCache { func (c *FriendCacheRedis) NewCache() FriendCache {
return &FriendCacheRedis{rcClient: c.rcClient, metaCache: c.metaCache, friendDB: c.friendDB, expireTime: c.expireTime} return &FriendCacheRedis{rcClient: c.rcClient, metaCache: NewMetaCacheRedis(c.rcClient, c.metaCache.GetPreDeleteKeys()...), friendDB: c.friendDB, expireTime: c.expireTime}
} }
func (f *FriendCacheRedis) getFriendIDsKey(ownerUserID string) string { func (f *FriendCacheRedis) getFriendIDsKey(ownerUserID string) string {

View File

@ -70,7 +70,7 @@ func NewGroupCacheRedis(rdb redis.UniversalClient, groupDB relationTb.GroupModel
} }
func (g *GroupCacheRedis) NewCache() GroupCache { func (g *GroupCacheRedis) NewCache() GroupCache {
return &GroupCacheRedis{rcClient: g.rcClient, expireTime: g.expireTime, groupDB: g.groupDB, groupMemberDB: g.groupMemberDB, groupRequestDB: g.groupRequestDB, mongoDB: g.mongoDB, metaCache: g.metaCache} return &GroupCacheRedis{rcClient: g.rcClient, expireTime: g.expireTime, groupDB: g.groupDB, groupMemberDB: g.groupMemberDB, groupRequestDB: g.groupRequestDB, mongoDB: g.mongoDB, metaCache: NewMetaCacheRedis(g.rcClient, g.metaCache.GetPreDeleteKeys()...)}
} }
func (g *GroupCacheRedis) getGroupInfoKey(groupID string) string { func (g *GroupCacheRedis) getGroupInfoKey(groupID string) string {

View File

@ -24,8 +24,8 @@ type metaCache interface {
GetPreDeleteKeys() []string GetPreDeleteKeys() []string
} }
func NewMetaCacheRedis(rcClient *rockscache.Client) metaCache { func NewMetaCacheRedis(rcClient *rockscache.Client, keys ...string) metaCache {
return &metaCacheRedis{rcClient: rcClient} return &metaCacheRedis{rcClient: rcClient, keys: keys}
} }
type metaCacheRedis struct { type metaCacheRedis struct {

View File

@ -44,7 +44,7 @@ func NewUserCacheRedis(rdb redis.UniversalClient, userDB relationTb.UserModelInt
func (u *UserCacheRedis) NewCache() UserCache { func (u *UserCacheRedis) NewCache() UserCache {
return &UserCacheRedis{ return &UserCacheRedis{
metaCache: u.metaCache, metaCache: NewMetaCacheRedis(u.rcClient, u.metaCache.GetPreDeleteKeys()...),
userDB: u.userDB, userDB: u.userDB,
expireTime: u.expireTime, expireTime: u.expireTime,
rcClient: u.rcClient, rcClient: u.rcClient,