LingxinMeng 10 月之前
父節點
當前提交
2ffe7ac24d
共有 1 個文件被更改,包括 4 次插入7 次删除
  1. 4 7
      aarch64/pjisuv/master/service/produce_window.go

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

@@ -1840,15 +1840,12 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *c
 		commonEntity.TimeWindowProducerQueueMutex.RLock()
 		defer commonEntity.TimeWindowProducerQueueMutex.RUnlock()
 		// 更新故障窗口end时间
-		latestEnd := util.TimeCustomChange(lastTimeWindow.TimeWindowBegin, commonConfig.PlatformConfig.TaskMaxTime) // 窗口最晚关闭时间是窗口开启时间加上最大任务时间
-		expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime)              // 窗口期望关闭时间是触发时间加上后置时间
-		if util.TimeCustom1GreaterTimeCustom2(expectEnd, latestEnd) {
-			latestTimeWindowEnd = latestEnd
+		expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime) // 窗口期望关闭时间是触发时间加上后置时间
+		expectLength := util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, expectEnd)
+		if expectLength < commonConfig.PlatformConfig.TaskMaxTime {
+			latestTimeWindowEnd = expectEnd
 			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