mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-27 14:02:15 +08:00
fix: the message I sent is not set to read seq in mongodb
This commit is contained in:
parent
38ae4e592c
commit
bcc7e777b8
@ -1,29 +0,0 @@
|
|||||||
package push
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/openimsdk/protocol/sdkws"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestName(t *testing.T) {
|
|
||||||
var c ConsumerHandler
|
|
||||||
c.readCh = make(chan *sdkws.MarkAsReadTips)
|
|
||||||
|
|
||||||
go c.loopRead()
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
for i := 0; ; i++ {
|
|
||||||
seq := int64(i + 1)
|
|
||||||
if seq%3 == 0 {
|
|
||||||
seq = 1
|
|
||||||
}
|
|
||||||
c.readCh <- &sdkws.MarkAsReadTips{
|
|
||||||
ConversationID: "c100",
|
|
||||||
MarkAsReadUserID: "u100",
|
|
||||||
HasReadSeq: seq,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
select {}
|
|
||||||
}
|
|
||||||
@ -254,7 +254,7 @@ func (db *msgTransferDatabase) BatchInsertChat2Cache(ctx context.Context, conver
|
|||||||
|
|
||||||
func (db *msgTransferDatabase) setHasReadSeqs(ctx context.Context, conversationID string, userSeqMap map[string]int64) error {
|
func (db *msgTransferDatabase) setHasReadSeqs(ctx context.Context, conversationID string, userSeqMap map[string]int64) error {
|
||||||
for userID, seq := range userSeqMap {
|
for userID, seq := range userSeqMap {
|
||||||
if err := db.seqUser.SetUserReadSeq(ctx, conversationID, userID, seq); err != nil {
|
if err := db.seqUser.SetUserReadSeqToDB(ctx, conversationID, userID, seq); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user