diff --git a/pkg/common/storage/cache/redis/msg.go b/pkg/common/storage/cache/redis/msg.go index 2d21cfe13..8362ded2f 100644 --- a/pkg/common/storage/cache/redis/msg.go +++ b/pkg/common/storage/cache/redis/msg.go @@ -16,6 +16,7 @@ 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" @@ -78,6 +79,7 @@ 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 { diff --git a/pkg/common/storage/cache/redis/msg_test.go b/pkg/common/storage/cache/redis/msg_test.go index de41cab9a..2beade88f 100644 --- a/pkg/common/storage/cache/redis/msg_test.go +++ b/pkg/common/storage/cache/redis/msg_test.go @@ -72,10 +72,10 @@ func Test_msgCache_GetMessagesBySeq(t *testing.T) { wantFailedSeqs []int64 wantErr assert.ErrorAssertionFunc }{ - {"test1", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Password: "openIM123"})}, + {"test1", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Password: "openIM123", DB: 0})}, args{context.Background(), "cid", []int64{1, 2, 3}}, []*sdkws.MsgData{{Seq: 1}, {Seq: 2}, {Seq: 3}}, []int64{}, assert.NoError}, - {"test2", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Password: "openIM123"})}, + {"test2", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Password: "openIM123", DB: 0})}, args{context.Background(), "cid", []int64{4, 5, 6}}, []*sdkws.MsgData{}, []int64{4, 5, 6}, assert.NoError}, }