From a0d61769b26c02b566ad414b5000c4a2639767f7 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 23 Mar 2023 17:51:38 +0800 Subject: [PATCH] ws update --- internal/msggateway/client.go | 2 +- internal/push/push_to_client.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/msggateway/client.go b/internal/msggateway/client.go index fa0729eb1..cd39f8f83 100644 --- a/internal/msggateway/client.go +++ b/internal/msggateway/client.go @@ -71,7 +71,7 @@ func (c *Client) readMessage() { if r := recover(); r != nil { fmt.Println("socket have panic err:", r, string(debug.Stack())) } - //c.close() + c.close() }() //var returnErr error for { diff --git a/internal/push/push_to_client.go b/internal/push/push_to_client.go index 72eb6547a..731403606 100644 --- a/internal/push/push_to_client.go +++ b/internal/push/push_to_client.go @@ -71,7 +71,7 @@ func (p *Pusher) MsgToUser(ctx context.Context, userID string, msg *sdkws.MsgDat } isOfflinePush := utils.GetSwitchFromOptions(msg.Options, constant.IsOfflinePush) //log.NewInfo(operationID, "push_result", wsResults, "sendData", msg, "isOfflinePush", isOfflinePush) - log.ZDebug(ctx, "push_result", "ws push result", wsResults, "sendData", msg, "isOfflinePush", isOfflinePush) + log.ZDebug(ctx, "push_result", "ws push result", wsResults, "sendData", msg, "isOfflinePush", isOfflinePush, "push_to_userID", userID) p.successCount++ if isOfflinePush && userID != msg.SendID { // save invitation info for offline push @@ -177,6 +177,7 @@ func (p *Pusher) MsgToSuperGroupUser(ctx context.Context, groupID string, msg *s func (p *Pusher) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.MsgData, pushToUserIDs []string) (wsResults []*msggateway.SingleMsgToUserResults, err error) { conns, err := p.client.GetConns(config.Config.RpcRegisterName.OpenImMessageGatewayName) + log.ZDebug(ctx, "get gateway conn", "conn length", len(conns)) if err != nil { return nil, err } @@ -185,7 +186,6 @@ func (p *Pusher) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.MsgData, msgClient := msggateway.NewMsgGatewayClient(v) reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(ctx, &msggateway.OnlineBatchPushOneMsgReq{MsgData: msg, PushToUserIDs: pushToUserIDs}) if err != nil { - continue } if reply != nil && reply.SinglePushResult != nil {