LingxinMeng 10 ヶ月 前
コミット
faeb984bb1
1 ファイル変更4 行追加1 行削除
  1. 4 1
      aarch64/pjisuv/master/service/produce_window.go

+ 4 - 1
aarch64/pjisuv/master/service/produce_window.go

@@ -29,7 +29,7 @@ var (
 		ObjSpeedDicOfTpperception: make(map[uint32]float64),
 	}
 	// 每个触发器5秒触发一次
-	triggerInterval = 5.0
+	triggerInterval = 3.0
 	// 保存时间窗口需要锁,防止数据竟态
 	saveTimeWindowMutex sync.Mutex
 	// /cicv_location
@@ -1846,6 +1846,9 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *c
 			latestTimeWindowEnd = latestEnd
 			lastTimeWindow.TimeWindowEnd = latestTimeWindowEnd
 			lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, lastTimeWindow.TimeWindowEnd)
+		} else {
+			lastTimeWindow.TimeWindowEnd = expectEnd
+			lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, lastTimeWindow.TimeWindowEnd)
 		}
 		// 更新label
 		labels := lastTimeWindow.Labels