From 96536e0052cc29e9fb9fab729fe2f50f53bcc084 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期五, 10 十一月 2023 17:56:53 +0800 Subject: [PATCH] 切换设备时不需要重启任务 --- nsq/msg_handler.go | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/nsq/msg_handler.go b/nsq/msg_handler.go index dea2aca..82d2118 100644 --- a/nsq/msg_handler.go +++ b/nsq/msg_handler.go @@ -268,6 +268,7 @@ Procedures: strings.Join(procedures, ","), ExtChannelAmount: msg.ExtChannelAmount, DeviceMac: msg.DeviceMac, + DeviceName: msg.DeviceName, } oldRecord, err := model.NewDeviceSearch().SetDeviceId(msg.ID).First() @@ -275,7 +276,8 @@ err = model.NewDeviceSearch().Create(deviceRecord) } else if oldRecord.ExtChannelAmount != deviceRecord.ExtChannelAmount || oldRecord.Procedures != deviceRecord.Procedures || - oldRecord.DeviceMac != deviceRecord.DeviceMac { + oldRecord.DeviceMac != deviceRecord.DeviceMac || + oldRecord.DeviceName != deviceRecord.DeviceName { err = model.NewDeviceSearch().SetDeviceId(msg.ID).Save(deviceRecord) } -- Gitblit v1.8.0