|
@@ -120,13 +120,10 @@ func PrepareTimeWindowProducerQueue() {
|
|
|
// 判断是否是连续故障码
|
|
|
gap := time.Since(entity.Subscriber2Time).Seconds()
|
|
|
if gap < 1 {
|
|
|
- entity.Subscriber2Time = time.Now()
|
|
|
entity.Subscriber2TimeMutex.Unlock()
|
|
|
return
|
|
|
} else {
|
|
|
// 2 不是连续故障码
|
|
|
- entity.Subscriber2Time = time.Now()
|
|
|
- entity.Subscriber2TimeMutex.Unlock()
|
|
|
subscriber2Mutex.Lock()
|
|
|
faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
lastTimeWindow := entity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
@@ -136,6 +133,8 @@ func PrepareTimeWindowProducerQueue() {
|
|
|
faultLabel = f(data, velocityX, velocityY, yaw)
|
|
|
if faultLabel != "" {
|
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
|
+ entity.Subscriber2Time = time.Now()
|
|
|
+ entity.Subscriber2TimeMutex.Unlock()
|
|
|
break
|
|
|
}
|
|
|
}
|