LingxinMeng hace 10 meses
padre
commit
8f1944efab
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      aarch64/pjisuv/master/service/move_bag_and_send_window.go

+ 3 - 0
aarch64/pjisuv/master/service/move_bag_and_send_window.go

@@ -65,6 +65,9 @@ func RunTimeWindowProducerQueue() {
 			// 获取copy目录下的字典json,key为触发时间,value为label
 			timeToLabelJson, _ := util.ReadFile(commonConfig.CloudConfig.TimeToLabelJsonPath)
 			timeToLabelMap, _ := util.JsonStringToMap(timeToLabelJson)
+			if timeToLabelMap == nil {
+				timeToLabelMap = make(map[string]interface{})
+			}
 			timeToLabelMap[currentTimeWindow.FaultTime] = util.ToString(currentTimeWindow.Labels)
 			timeToLabelJson, _ = util.MapToJsonString(timeToLabelMap)
 			_ = util.WriteFile(timeToLabelJson, commonConfig.CloudConfig.TimeToLabelJsonPath)