From fefe59debf0a09432ac3cec0c4244754335bab06 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 20 Dec 2022 20:06:50 +0800 Subject: [PATCH] update push --- internal/logic/domain/message/service/message_service.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/logic/domain/message/service/message_service.go b/internal/logic/domain/message/service/message_service.go index 339c3c0..e39600c 100644 --- a/internal/logic/domain/message/service/message_service.go +++ b/internal/logic/domain/message/service/message_service.go @@ -159,7 +159,6 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser if sender.DeviceId == devices[i].DeviceId { continue } - err = MessageService.SendToDevice(ctx, devices[i], &message) if err != nil { logger.Sugar.Error(err, zap.Any("SendToUser error", devices[i]), zap.Error(err)) @@ -171,6 +170,10 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser // SendToDevice 将消息发送给设备 func (*messageService) SendToDevice(ctx context.Context, device *pb.Device, message *pb.Message) error { + utils.FilePutContents("sendToDevice", utils.SerializeStr(map[string]interface{}{ + "device": device, + "message": message, + })) messageSend := pb.MessageSend{Message: message} _, err := rpc.GetConnectIntClient().DeliverMessage(picker.ContextWithAddr(ctx, device.ConnAddr), &pb.DeliverMessageReq{ DeviceId: device.DeviceId,