From 724530a434d4ac18aa5428838a09fa4c7df0b2a4 Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Fri, 2 Aug 2024 10:28:55 +0800 Subject: [PATCH] test: unonline can push --- internal/push/push_handler.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go index 249622a592..f83074eba2 100644 --- a/internal/push/push_handler.go +++ b/internal/push/push_handler.go @@ -187,17 +187,18 @@ func (c *ConsumerHandler) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws. onlineUserIDs []string offlineUserIDs []string ) - for _, userID := range pushToUserIDs { - online, err := c.onlineCache.GetUserOnline(ctx, userID) - if err != nil { - return nil, err - } - if online { - onlineUserIDs = append(onlineUserIDs, userID) - } else { - offlineUserIDs = append(offlineUserIDs, userID) - } - } + onlineUserIDs = pushToUserIDs + //for _, userID := range pushToUserIDs { + // online, err := c.onlineCache.GetUserOnline(ctx, userID) + // if err != nil { + // return nil, err + // } + // if online { + // onlineUserIDs = append(onlineUserIDs, userID) + // } else { + // offlineUserIDs = append(offlineUserIDs, userID) + // } + //} log.ZDebug(ctx, "GetConnsAndOnlinePush online cache", "sendID", msg.SendID, "recvID", msg.RecvID, "groupID", msg.GroupID, "sessionType", msg.SessionType, "clientMsgID", msg.ClientMsgID, "serverMsgID", msg.ServerMsgID, "offlineUserIDs", offlineUserIDs, "onlineUserIDs", onlineUserIDs) var result []*msggateway.SingleMsgToUserResults if len(onlineUserIDs) > 0 {