|
@@ -36,24 +36,22 @@ func PrepareTimeWindowProducerQueue() {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
prepareTimeWindowProducerQueueMutex.Lock()
|
|
prepareTimeWindowProducerQueueMutex.Lock()
|
|
- {
|
|
|
|
- // 接收数据
|
|
|
|
- buffer := make([]byte, 2048)
|
|
|
|
- total, err := conn.Read(buffer)
|
|
|
|
- if err != nil {
|
|
|
|
- commonCfg.GlobalLogger.Error("读取数据错误:", err)
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- // 将JSON转换为结构体
|
|
|
|
- var timeWindow ent.TimeWindow
|
|
|
|
- err = json.Unmarshal(buffer[:total], &timeWindow)
|
|
|
|
- if err != nil {
|
|
|
|
- commonCfg.GlobalLogger.Error("解析Json时出错:", err)
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- //commonCfg.GlobalLogger.Info("接收到时间窗口:",timeWindow)
|
|
|
|
- util.AddTimeWindowToTimeWindowProducerQueue(timeWindow)
|
|
|
|
|
|
+ // 接收数据
|
|
|
|
+ buffer := make([]byte, 2048)
|
|
|
|
+ total, err := conn.Read(buffer)
|
|
|
|
+ if err != nil {
|
|
|
|
+ commonCfg.GlobalLogger.Error("读取数据错误:", err)
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ // 将JSON转换为结构体
|
|
|
|
+ var timeWindow ent.TimeWindow
|
|
|
|
+ err = json.Unmarshal(buffer[:total], &timeWindow)
|
|
|
|
+ if err != nil {
|
|
|
|
+ commonCfg.GlobalLogger.Error("解析Json时出错:", err)
|
|
|
|
+ continue
|
|
}
|
|
}
|
|
|
|
+ //commonCfg.GlobalLogger.Info("接收到时间窗口:",timeWindow)
|
|
|
|
+ util.AddTimeWindowToTimeWindowProducerQueue(timeWindow)
|
|
prepareTimeWindowProducerQueueMutex.Unlock()
|
|
prepareTimeWindowProducerQueueMutex.Unlock()
|
|
}
|
|
}
|
|
}
|
|
}
|