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

This commit is contained in:
GoEdgeLab
2023-04-07 11:32:40 +08:00
parent 6c6317af56
commit 8b66d2c716

View File

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