1234567891011121314151617181920212223242526272829 |
- package service
- import (
- "cicv-data-closedloop/common/util"
- "sync"
- )
- var (
- MonitorQueue = make([]MonitorInfo, 0, QueueLength)
- QueueLength = 120
- mu sync.Mutex
- )
- type MonitorInfo struct {
- Time string
- }
- func CacheMonitorQueue() {
- mu.Lock()
- defer mu.Unlock()
-
-
- if len(MonitorQueue) >= QueueLength {
- MonitorQueue = MonitorQueue[1:]
- }
-
- MonitorQueue = append(MonitorQueue, MonitorInfo{Time: util.GetNowTimeCustom()})
- }
|