From dd75b36c03049be232a94d97eff1c4a5cc751fb5 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 31 十月 2023 22:08:39 +0800
Subject: [PATCH] 支持设备ID切换

---
 crontask/cron_task.go |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/crontask/cron_task.go b/crontask/cron_task.go
index cd4e9e6..230d38e 100644
--- a/crontask/cron_task.go
+++ b/crontask/cron_task.go
@@ -143,11 +143,12 @@
 	caller := nsq.NewCaller(fmt.Sprintf(constvar.NsqTopicPullDataRequest, conf.Conf.NsqConf.NodeId), constvar.NsqTopicPullDataResponse)
 	err := caller.Send(msg)
 	if err != nil {
-		logx.Errorf("send pull data msg error:%v", err.Error())
+		logx.Errorf("send pull data msg error:%v, msg:%+v", err.Error(), msg)
 	}
-	caller = nsq.NewCaller(fmt.Sprintf(constvar.NsqTopicGetPlcAddress, conf.Conf.NsqConf.NodeId), "")
-	err = caller.Send(common.RequestPlcAddress{DeviceId: conf.Conf.System.DeviceId})
+	msg = &common.MsgPullDataRequest{DataType: common.PullDataTypeDevice}
+	caller = nsq.NewCaller(fmt.Sprintf(constvar.NsqTopicPullDataRequest, conf.Conf.NsqConf.NodeId), constvar.NsqTopicPullDataResponse)
+	err = caller.Send(msg)
 	if err != nil {
-		logx.Infof("get plc address err: %v", err.Error())
+		logx.Errorf("send pull data msg error:%v, msg:%+v", err.Error(), msg)
 	}
 }

--
Gitblit v1.8.0