From b1114569135bbcbab8a095ebe37f4800183d2c5f Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 09 四月 2024 10:17:57 +0800 Subject: [PATCH] fix --- crontask/cron_task.go | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/crontask/cron_task.go b/crontask/cron_task.go index 226b938..d599a87 100644 --- a/crontask/cron_task.go +++ b/crontask/cron_task.go @@ -49,6 +49,7 @@ _ = service.NewProgressService().UpdateProgress(conf.Conf.CurrentDeviceID, addressItem.Channel, finishNumber) } logx.Infof("plc read finish number: %v", finishNumber) + time.Sleep(time.Second * 1) } else if addressItem.FieldName == constvar.PlcStartAddressTypeTotalNumber { value, err := service.PlcReadDirect(plcConfig, addressItem) if err != nil { @@ -60,6 +61,7 @@ service.PlcCacheSet(conf.Conf.CurrentDeviceID, addressItem.Channel, constvar.PlcCacheKeyTotalNumber, totalNumber) } logx.Infof("plc read total number: %v", totalNumber) + time.Sleep(time.Second * 1) } } @@ -89,6 +91,9 @@ return } for _, progress := range progressList { + if progress.FinishedQuantity == 0 { + continue + } caller := nsq.NewCaller(fmt.Sprintf(constvar.NsqTopicSyncTaskProgress, conf.Conf.NsqConf.NodeId), "") err = caller.Send(progress) if err != nil { -- Gitblit v1.8.0