lora mesh 发送即收到
This commit is contained in:
@@ -113,6 +113,13 @@ func (g *GeneralDeviceService) Switch(device *models.Device, action DeviceAction
|
||||
DeviceID: areaController.ID,
|
||||
SentAt: time.Now(),
|
||||
}
|
||||
if sendResult.AcknowledgedAt != nil {
|
||||
logRecord.AcknowledgedAt = sendResult.AcknowledgedAt
|
||||
}
|
||||
if sendResult.ReceivedSuccess != nil {
|
||||
logRecord.ReceivedSuccess = *sendResult.ReceivedSuccess
|
||||
}
|
||||
|
||||
if err := g.deviceCommandLogRepo.Create(logRecord); err != nil {
|
||||
// 记录日志失败是一个需要关注的问题,但可能不应该中断主流程。
|
||||
// 我们记录一个错误日志,然后成功返回。
|
||||
|
||||
Reference in New Issue
Block a user