test-errcode
wangchuxiao 2 years ago
parent cf8d52d305
commit b89d5ec0ab

@ -317,7 +317,7 @@ func (db *commonMsgDatabase) getMsgBySeqs(ctx context.Context, conversationID st
m := db.msg.GetDocIDSeqsMap(conversationID, seqs)
var totalUnExistSeqs []int64
for docID, seqs := range m {
log.ZDebug(ctx, "getMsgBySeqsRange", "docID", docID, "seqs", seqs)
log.ZDebug(ctx, "getMsgBySeqs", "docID", docID, "seqs", seqs)
seqMsgs, unexistSeqs, err := db.findMsgBySeq(ctx, docID, seqs)
if err != nil {
return nil, err
@ -347,8 +347,8 @@ func (db *commonMsgDatabase) refetchDelSeqsMsgs(ctx context.Context, conversatio
}
if len(reFetchSeqs) > 0 {
m := db.msg.GetDocIDSeqsMap(conversationID, reFetchSeqs)
for docID, seq := range m {
msgs, _, err := db.findMsgBySeq(ctx, docID, seq)
for docID, seqs := range m {
msgs, _, err := db.findMsgBySeq(ctx, docID, seqs)
if err != nil {
return nil, err
}
@ -458,7 +458,7 @@ func (db *commonMsgDatabase) GetMsgBySeqsRange(ctx context.Context, conversation
var seqs []int64
for i := end; i > end-num; i-- {
if i >= begin {
seqs = append(seqs, i)
seqs = append([]int64{i}, seqs...)
} else {
break
}

@ -293,7 +293,7 @@ func GetSeqsBeginEnd(seqs []int64) (int64, int64) {
if len(seqs) == 0 {
return 0, 0
}
return seqs[len(seqs)-1], seqs[0]
return seqs[0], seqs[len(seqs)-1]
}
type MsgBySeq []*sdkws.MsgData

Loading…
Cancel
Save