refactor: delete message and message batch use lua.

pull/2325/head
Gordon 1 year ago
parent bcf089cb07
commit b98c54e795

@ -16,7 +16,6 @@ package redis
import (
"context"
"fmt"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey"
"github.com/openimsdk/open-im-server/v3/pkg/msgprocessor"
@ -72,7 +71,6 @@ func (c *msgCache) SetMessagesToCache(ctx context.Context, conversationID string
var values []string
for _, key := range keys {
if msg, ok := msgMap[key]; ok {
fmt.Print("rdb msgData is ", key, msg)
s, err := msgprocessor.Pb2String(msg)
if err != nil {
return err
@ -80,7 +78,6 @@ func (c *msgCache) SetMessagesToCache(ctx context.Context, conversationID string
values = append(values, s)
}
}
fmt.Print("rdb values is ", keys, values)
return LuaSetBatchWithCommonExpire(ctx, c.rdb, keys, values, msgCacheTimeout)
})
if err != nil {
@ -173,7 +170,6 @@ func (c *msgCache) GetMessagesBySeq(ctx context.Context, conversationID string,
msg := &sdkws.MsgData{}
msgString, ok := value.(string)
fmt.Println("get result", "seq", seq, "msg string", msgString)
if !ok || msgprocessor.String2Pb(msgString, msg) != nil {
failedSeqs = append(failedSeqs, seq)
continue

@ -66,7 +66,6 @@ func Test_msgCache_GetMessagesBySeq(t *testing.T) {
seqs []int64
}
var failedSeq []int64
//var seqMsg []*sdkws.MsgData
tests := []struct {
name string
fields fields

Loading…
Cancel
Save