mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
fix: zk add close to avoid zk block. (#1284)
* fix: zk add close to avoid zk block. * fix: zk add close to avoid zk block. * fix: zk add close to avoid zk block. * fix: zk add close to avoid zk block.
This commit is contained in:
@@ -62,6 +62,11 @@ func (m *msgServer) PullMessageBySeqs(
|
||||
case sdkws.PullOrder_PullOrderDesc:
|
||||
isEnd = seq.Begin <= minSeq
|
||||
}
|
||||
if len(msgs) == 0 {
|
||||
log.ZWarn(ctx, "not have msgs", nil, "conversationID", seq.ConversationID, "seq", seq)
|
||||
|
||||
continue
|
||||
}
|
||||
resp.Msgs[seq.ConversationID] = &sdkws.PullMsgs{Msgs: msgs, IsEnd: isEnd}
|
||||
} else {
|
||||
var seqs []int64
|
||||
@@ -71,6 +76,7 @@ func (m *msgServer) PullMessageBySeqs(
|
||||
minSeq, maxSeq, notificationMsgs, err := m.MsgDatabase.GetMsgBySeqs(ctx, req.UserID, seq.ConversationID, seqs)
|
||||
if err != nil {
|
||||
log.ZWarn(ctx, "GetMsgBySeqs error", err, "conversationID", seq.ConversationID, "seq", seq)
|
||||
|
||||
continue
|
||||
}
|
||||
var isEnd bool
|
||||
@@ -80,6 +86,11 @@ func (m *msgServer) PullMessageBySeqs(
|
||||
case sdkws.PullOrder_PullOrderDesc:
|
||||
isEnd = seq.Begin <= minSeq
|
||||
}
|
||||
if len(notificationMsgs) == 0 {
|
||||
log.ZWarn(ctx, "not have notificationMsgs", nil, "conversationID", seq.ConversationID, "seq", seq)
|
||||
|
||||
continue
|
||||
}
|
||||
resp.NotificationMsgs[seq.ConversationID] = &sdkws.PullMsgs{Msgs: notificationMsgs, IsEnd: isEnd}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user