mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-09 22:17:27 +08:00
test: for pressure test.
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
This commit is contained in:
parent
efac72ecda
commit
6deeccc865
@ -126,6 +126,7 @@ func (c *Client) readMessage() {
|
|||||||
for {
|
for {
|
||||||
messageType, message, returnErr := c.conn.ReadMessage()
|
messageType, message, returnErr := c.conn.ReadMessage()
|
||||||
if returnErr != nil {
|
if returnErr != nil {
|
||||||
|
log.ZWarn(c.ctx, "readMessage", returnErr, "messageType", messageType)
|
||||||
c.closedErr = returnErr
|
c.closedErr = returnErr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
19
pkg/common/db/cache/conversation.go
vendored
19
pkg/common/db/cache/conversation.go
vendored
@ -58,11 +58,8 @@ type ConversationCache interface {
|
|||||||
DelConversations(ownerUserID string, conversationIDs ...string) ConversationCache
|
DelConversations(ownerUserID string, conversationIDs ...string) ConversationCache
|
||||||
DelUsersConversation(conversationID string, ownerUserIDs ...string) ConversationCache
|
DelUsersConversation(conversationID string, ownerUserIDs ...string) ConversationCache
|
||||||
// get one conversation from msgCache
|
// get one conversation from msgCache
|
||||||
GetConversations(
|
GetConversations(ctx context.Context, ownerUserID string,
|
||||||
ctx context.Context,
|
conversationIDs []string) ([]*relationtb.ConversationModel, error)
|
||||||
ownerUserID string,
|
|
||||||
conversationIDs []string,
|
|
||||||
) ([]*relationtb.ConversationModel, error)
|
|
||||||
// get one user's all conversations from msgCache
|
// get one user's all conversations from msgCache
|
||||||
GetUserAllConversations(ctx context.Context, ownerUserID string) ([]*relationtb.ConversationModel, error)
|
GetUserAllConversations(ctx context.Context, ownerUserID string) ([]*relationtb.ConversationModel, error)
|
||||||
// get user conversation recv msg from msgCache
|
// get user conversation recv msg from msgCache
|
||||||
@ -78,10 +75,8 @@ type ConversationCache interface {
|
|||||||
GetUserAllHasReadSeqs(ctx context.Context, ownerUserID string) (map[string]int64, error)
|
GetUserAllHasReadSeqs(ctx context.Context, ownerUserID string) (map[string]int64, error)
|
||||||
DelUserAllHasReadSeqs(ownerUserID string, conversationIDs ...string) ConversationCache
|
DelUserAllHasReadSeqs(ownerUserID string, conversationIDs ...string) ConversationCache
|
||||||
|
|
||||||
GetConversationsByConversationID(
|
GetConversationsByConversationID(ctx context.Context,
|
||||||
ctx context.Context,
|
conversationIDs []string) ([]*relationtb.ConversationModel, error)
|
||||||
conversationIDs []string,
|
|
||||||
) ([]*relationtb.ConversationModel, error)
|
|
||||||
DelConversationByConversationID(conversationIDs ...string) ConversationCache
|
DelConversationByConversationID(conversationIDs ...string) ConversationCache
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,10 +406,8 @@ func (c *ConversationRedisCache) GetUserAllHasReadSeqs(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ConversationRedisCache) DelUserAllHasReadSeqs(
|
func (c *ConversationRedisCache) DelUserAllHasReadSeqs(ownerUserID string,
|
||||||
ownerUserID string,
|
conversationIDs ...string) ConversationCache {
|
||||||
conversationIDs ...string,
|
|
||||||
) ConversationCache {
|
|
||||||
cache := c.NewCache()
|
cache := c.NewCache()
|
||||||
for _, conversationID := range conversationIDs {
|
for _, conversationID := range conversationIDs {
|
||||||
cache.AddKeys(c.getConversationHasReadSeqKey(ownerUserID, conversationID))
|
cache.AddKeys(c.getConversationHasReadSeqKey(ownerUserID, conversationID))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user