mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 11:36:44 +08:00
cache
This commit is contained in:
parent
fa477c2d17
commit
becbba877a
2
pkg/common/db/cache/black.go
vendored
2
pkg/common/db/cache/black.go
vendored
@ -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()...),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
pkg/common/db/cache/conversation.go
vendored
2
pkg/common/db/cache/conversation.go
vendored
@ -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 {
|
||||||
|
2
pkg/common/db/cache/extend_msg_set.go
vendored
2
pkg/common/db/cache/extend_msg_set.go
vendored
@ -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,
|
||||||
|
2
pkg/common/db/cache/friend.go
vendored
2
pkg/common/db/cache/friend.go
vendored
@ -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 {
|
||||||
|
2
pkg/common/db/cache/group.go
vendored
2
pkg/common/db/cache/group.go
vendored
@ -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 {
|
||||||
|
4
pkg/common/db/cache/rockscache.go
vendored
4
pkg/common/db/cache/rockscache.go
vendored
@ -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 {
|
||||||
|
2
pkg/common/db/cache/user.go
vendored
2
pkg/common/db/cache/user.go
vendored
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user