diff --git a/pkg/common/db/cache/black.go b/pkg/common/db/cache/black.go index ae4e9d680..e4a8b1f4f 100644 --- a/pkg/common/db/cache/black.go +++ b/pkg/common/db/cache/black.go @@ -46,6 +46,7 @@ func (b *BlackCacheRedis) NewCache() BlackCache { expireTime: b.expireTime, rcClient: b.rcClient, blackDB: b.blackDB, + metaCache: NewMetaCacheRedis(b.rcClient), } } diff --git a/pkg/common/db/cache/conversation.go b/pkg/common/db/cache/conversation.go index 073f6ff55..add27b3c3 100644 --- a/pkg/common/db/cache/conversation.go +++ b/pkg/common/db/cache/conversation.go @@ -68,7 +68,7 @@ func NewNewConversationRedis(rdb redis.UniversalClient, conversationDB *relation } func (c *ConversationRedisCache) NewCache() ConversationCache { - return &ConversationRedisCache{rcClient: c.rcClient, metaCache: c.metaCache, conversationDB: c.conversationDB, expireTime: c.expireTime} + return &ConversationRedisCache{rcClient: c.rcClient, metaCache: NewMetaCacheRedis(c.rcClient), conversationDB: c.conversationDB, expireTime: c.expireTime} } func (c *ConversationRedisCache) getConversationKey(ownerUserID, conversationID string) string { @@ -157,16 +157,6 @@ func (c *ConversationRedisCache) GetUserAllConversations(ctx context.Context, ow }) } -func (c *ConversationRedisCache) DelUserConversations(ctx context.Context, ownerUserID string, conversationIDs []string) ConversationCache { - var keys []string - for _, conversationID := range conversationIDs { - keys = append(keys, c.getConversationKey(ownerUserID, conversationID)) - } - cache := c.NewCache() - cache.AddKeys(keys...) - return cache -} - func (c *ConversationRedisCache) GetUserRecvMsgOpt(ctx context.Context, ownerUserID, conversationID string) (opt int, err error) { return getCache(ctx, c.rcClient, c.getRecvMsgOptKey(ownerUserID, conversationID), c.expireTime, func(ctx context.Context) (opt int, err error) { return c.conversationDB.GetUserRecvMsgOpt(ctx, ownerUserID, conversationID)