diff --git a/internal/rpc/msg/delete.go b/internal/rpc/msg/delete.go index 8220e94a4..b0a18b999 100644 --- a/internal/rpc/msg/delete.go +++ b/internal/rpc/msg/delete.go @@ -34,10 +34,11 @@ func (m *msgServer) UserClearAllMsg(ctx context.Context, req *msg.UserClearAllMs if err := tokenverify.CheckAccessV3(ctx, req.UserID); err != nil { return nil, err } - conversationIDs, err := m.Conversation.GetConversationIDs(ctx, req.UserID) + conversationIDs, err := m.ConversationLocalCache.GetConversationIDs(ctx, req.UserID) if err != nil { return nil, err } + log.ZDebug(ctx, "GetMaxSeq", "conversationIDs", conversationIDs) maxSeqs, err := m.MsgDatabase.GetMaxSeqs(ctx, conversationIDs) if err != nil { return nil, err diff --git a/pkg/common/db/cache/msg.go b/pkg/common/db/cache/msg.go index 54690cb51..b856eccfe 100644 --- a/pkg/common/db/cache/msg.go +++ b/pkg/common/db/cache/msg.go @@ -170,7 +170,7 @@ func (c *msgCache) GetMinSeq(ctx context.Context, conversationID string) (int64, } func (c *msgCache) getConversationUserMinSeqKey(conversationID, userID string) string { - return conversationUserMinSeq + "g:" + conversationID + "u:" + userID + return conversationUserMinSeq + conversationID + "u:" + userID } func (c *msgCache) GetConversationUserMinSeq(ctx context.Context, conversationID string, userID string) (int64, error) { diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index dbb0cdacf..a3de6d414 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -206,16 +206,6 @@ func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, userID, doc return nil, err } } - ////i := 0 - //for cursor.Next(ctx) { - // err := cursor.Decode(&doc) - // if err != nil { - // return nil, err - // } - // //if i == 0 { - // // break - // //} - //} log.ZDebug(ctx, "msgInfos", "num", len(doc.Msg), "docID", docID) for _, v := range doc.Msg { if v.Msg == nil {