fix
zhangqian
2024-04-09 b1114569135bbcbab8a095ebe37f4800183d2c5f
main.go
@@ -14,6 +14,7 @@
   "fmt"
   "log"
   "net/http"
   _ "net/http/pprof"
   "time"
)
@@ -37,13 +38,14 @@
   var syncTables = []string{
      "procedures",
      "process_model",
      "production_progress",
      "work_order",
      "task_status_sync",
      "device",
      "device_plc",
      "system_status",
      "process_model_plc_address",
      "reports_to_cloud",
      "report_work",
   }
   agent := serf.InitAgent("apsClient", syncTables, sqlitex.GetDB())
@@ -56,12 +58,16 @@
   }
   //从文件里读取当前生产设备id获取设备列表第一个
   err := service.InitCurrentDeviceID()
   err := service.InitCurrentDeviceID(serf.Vasystem.ServerID)
   if err != nil {
      logx.Errorf("InitCurrentDeviceID error: %v, exit", err)
      return
   }
   go func() {
      service.ReportsSystemDeviceToCloud(serf.Vasystem.ServerID)
   }()
   // 判断当前集群状态
   logx.Infof("current agent.ClusterStatus:%v", agent.ClusterStatus)
   log.Println("current agent.ClusterStatus:", agent.ClusterStatus)