Skip to content

Commit

Permalink
test: unonline can push
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Aug 2, 2024
1 parent 51e170a commit 724530a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions internal/push/push_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 724530a

Please sign in to comment.