mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 19:32:17 +08:00 
			
		
		
		
	refactor: delete message and message batch use lua.
This commit is contained in:
		
							parent
							
								
									fc02fb7c04
								
							
						
					
					
						commit
						b3ee2d9edb
					
				
							
								
								
									
										71
									
								
								pkg/common/storage/cache/redis/msg_test.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										71
									
								
								pkg/common/storage/cache/redis/msg_test.go
									
									
									
									
										vendored
									
									
								
							@ -39,7 +39,76 @@ func Test_msgCache_SetMessagesToCache(t *testing.T) {
 | 
				
			|||||||
		wantErr assert.ErrorAssertionFunc
 | 
							wantErr assert.ErrorAssertionFunc
 | 
				
			||||||
	}{
 | 
						}{
 | 
				
			||||||
		{"test1", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Username: "", Password: "openIM123", DB: 0})}, args{context.Background(),
 | 
							{"test1", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Username: "", Password: "openIM123", DB: 0})}, args{context.Background(),
 | 
				
			||||||
			"cid", []*sdkws.MsgData{{Seq: 1}, {Seq: 2}, {Seq: 3}}}, 3, assert.NoError},
 | 
								"cid", []*sdkws.MsgData{{
 | 
				
			||||||
 | 
									SendID:           "1",
 | 
				
			||||||
 | 
									RecvID:           "2",
 | 
				
			||||||
 | 
									GroupID:          "3",
 | 
				
			||||||
 | 
									ClientMsgID:      "sdfsdf",
 | 
				
			||||||
 | 
									ServerMsgID:      "234234",
 | 
				
			||||||
 | 
									SenderPlatformID: 0,
 | 
				
			||||||
 | 
									SenderNickname:   "",
 | 
				
			||||||
 | 
									SenderFaceURL:    "",
 | 
				
			||||||
 | 
									SessionType:      0,
 | 
				
			||||||
 | 
									MsgFrom:          0,
 | 
				
			||||||
 | 
									ContentType:      0,
 | 
				
			||||||
 | 
									Content:          nil,
 | 
				
			||||||
 | 
									Seq:              1,
 | 
				
			||||||
 | 
									SendTime:         0,
 | 
				
			||||||
 | 
									CreateTime:       0,
 | 
				
			||||||
 | 
									Status:           0,
 | 
				
			||||||
 | 
									IsRead:           false,
 | 
				
			||||||
 | 
									Options:          nil,
 | 
				
			||||||
 | 
									OfflinePushInfo:  nil,
 | 
				
			||||||
 | 
									AtUserIDList:     nil,
 | 
				
			||||||
 | 
									AttachedInfo:     "",
 | 
				
			||||||
 | 
									Ex:               "",
 | 
				
			||||||
 | 
								}, {
 | 
				
			||||||
 | 
									SendID:           "2",
 | 
				
			||||||
 | 
									RecvID:           "3",
 | 
				
			||||||
 | 
									GroupID:          "4",
 | 
				
			||||||
 | 
									ClientMsgID:      "sdfsdfsd",
 | 
				
			||||||
 | 
									ServerMsgID:      "sdfsdf",
 | 
				
			||||||
 | 
									SenderPlatformID: 0,
 | 
				
			||||||
 | 
									SenderNickname:   "",
 | 
				
			||||||
 | 
									SenderFaceURL:    "",
 | 
				
			||||||
 | 
									SessionType:      0,
 | 
				
			||||||
 | 
									MsgFrom:          0,
 | 
				
			||||||
 | 
									ContentType:      0,
 | 
				
			||||||
 | 
									Content:          nil,
 | 
				
			||||||
 | 
									Seq:              2,
 | 
				
			||||||
 | 
									SendTime:         0,
 | 
				
			||||||
 | 
									CreateTime:       0,
 | 
				
			||||||
 | 
									Status:           0,
 | 
				
			||||||
 | 
									IsRead:           false,
 | 
				
			||||||
 | 
									Options:          nil,
 | 
				
			||||||
 | 
									OfflinePushInfo:  nil,
 | 
				
			||||||
 | 
									AtUserIDList:     nil,
 | 
				
			||||||
 | 
									AttachedInfo:     "",
 | 
				
			||||||
 | 
									Ex:               "",
 | 
				
			||||||
 | 
								}, {
 | 
				
			||||||
 | 
									SendID:           "5",
 | 
				
			||||||
 | 
									RecvID:           "6",
 | 
				
			||||||
 | 
									GroupID:          "7",
 | 
				
			||||||
 | 
									ClientMsgID:      "sdfd",
 | 
				
			||||||
 | 
									ServerMsgID:      "sdfsdf",
 | 
				
			||||||
 | 
									SenderPlatformID: 0,
 | 
				
			||||||
 | 
									SenderNickname:   "",
 | 
				
			||||||
 | 
									SenderFaceURL:    "",
 | 
				
			||||||
 | 
									SessionType:      0,
 | 
				
			||||||
 | 
									MsgFrom:          0,
 | 
				
			||||||
 | 
									ContentType:      0,
 | 
				
			||||||
 | 
									Content:          nil,
 | 
				
			||||||
 | 
									Seq:              3,
 | 
				
			||||||
 | 
									SendTime:         0,
 | 
				
			||||||
 | 
									CreateTime:       0,
 | 
				
			||||||
 | 
									Status:           0,
 | 
				
			||||||
 | 
									IsRead:           false,
 | 
				
			||||||
 | 
									Options:          nil,
 | 
				
			||||||
 | 
									OfflinePushInfo:  nil,
 | 
				
			||||||
 | 
									AtUserIDList:     nil,
 | 
				
			||||||
 | 
									AttachedInfo:     "",
 | 
				
			||||||
 | 
									Ex:               "",
 | 
				
			||||||
 | 
								}}}, 3, assert.NoError},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	for _, tt := range tests {
 | 
						for _, tt := range tests {
 | 
				
			||||||
		t.Run(tt.name, func(t *testing.T) {
 | 
							t.Run(tt.name, func(t *testing.T) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user