从文件恢复带宽数据时跳过非今天的数据

This commit is contained in:
刘祥超
2023-04-07 11:32:40 +08:00
parent 0af580eb26
commit 6da9cb6dcf

View File

@@ -292,6 +292,9 @@ func (this *BandwidthStatManager) recover() {
if err == nil && len(m) > 0 { if err == nil && len(m) > 0 {
var lastTime = "" var lastTime = ""
for _, stat := range m { for _, stat := range m {
if stat.Day != utils.Ymd() {
continue
}
if len(lastTime) == 0 || stat.TimeAt > lastTime { if len(lastTime) == 0 || stat.TimeAt > lastTime {
lastTime = stat.TimeAt lastTime = stat.TimeAt
} }