Browse Source

Update:优化设备编号重复导致导出异常

zoie 8 months ago
parent
commit
5a5ecf8d92
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Nats/Nats.go

+ 6 - 1
Nats/Nats.go

@@ -65,9 +65,14 @@ func NatsInit() {
 		for _, v := range resp.DeviceClassList {
 			DeviceClassList.Store(fmt.Sprintf("%s|%s", v.T_sn, v.T_id), 5)
 			//err = Task.Import_TaskData_Back(v.T_sn, v.T_id, resp.Task.T_task_id, resp.Time_start, resp.Time_end)
-			count++
+			//count++
 			//time.Sleep(5 * time.Second)
 		}
+		DeviceClassList.Range(func(k, v interface{}) bool {
+			count++
+			return true
+		})
+
 		for count > 0 {
 			DeviceClassList.Range(func(k, v any) bool {
 				T_snid := strings.Split(k.(string), "|")