zhangqian
2023-10-13 f838162ed0ee7f2832924c2399eddd461760135a
nsq/nsq.go
@@ -3,7 +3,6 @@
import (
   "apsClient/conf"
   "apsClient/constvar"
   "apsClient/model/common"
   "apsClient/pkg/logx"
   "apsClient/pkg/safe"
   "basic.com/aps/nsqclient.git"
@@ -11,7 +10,6 @@
   "errors"
   "fmt"
   "sync"
   "time"
)
type consumerManager struct {
@@ -32,14 +30,6 @@
   if err := initProducer(); err != nil {
      return err
   }
   safe.Go(func() {
      caller := NewCaller(fmt.Sprintf(constvar.NsqTopicGetPlcAddress, conf.Conf.NsqConf.NodeId), fmt.Sprintf(constvar.NsqTopicSendPlcAddress, conf.Conf.NsqConf.NodeId))
      var addressResult common.ResponsePlcAddress
      err := caller.Call(common.RequestPlcAddress{DeviceId: conf.Conf.System.DeviceId}, &addressResult, time.Second*3)
      if err != nil {
         logx.Infof("get plc address err: %v", err.Error())
      }
   })
   var topics = []string{
      constvar.NsqTopicScheduleTask,
@@ -47,6 +37,7 @@
      constvar.NsqTopicProcessParamsResponse,
      constvar.NsqTopicApsProcessParams,
      constvar.NsqTopicDeviceUpdate,
      constvar.NsqTopicPullDataResponse,
   }
   for _, t := range topics {
      topic := fmt.Sprintf(t, conf.Conf.NsqConf.NodeId)