Pārlūkot izejas kodu

update push

master
DengBiao pirms 1 gada
vecāks
revīzija
fefe59debf
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. +4
    -1
      internal/logic/domain/message/service/message_service.go

+ 4
- 1
internal/logic/domain/message/service/message_service.go Parādīt failu

@@ -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,


Notiek ielāde…
Atcelt
Saglabāt