fix: ограничить статистику 7 днями и убрать 30d из дашборда

This commit is contained in:
2026-05-09 16:07:54 +05:00
parent 78656e74b0
commit 44c01d39d0
6 changed files with 62 additions and 22 deletions
-2
View File
@@ -72,7 +72,6 @@ func saveAccountTraffic(apiPort int64, trafficStatsSecret string) {
nowMs := time.Now().UnixMilli()
hourStart := nowMs - (nowMs % int64(time.Hour/time.Millisecond))
dayStart := nowMs - (nowMs % int64(24*time.Hour/time.Millisecond))
for key, traffic := range users {
rxBytes := traffic.Rx
@@ -115,7 +114,6 @@ func saveAccountTraffic(apiPort int64, trafficStatsSecret string) {
}
_ = dao.UpsertTrafficAggregateHourly(*peer.Id, hourStart, rxBytes, txBytes)
_ = dao.UpsertTrafficAggregateDaily(*peer.Id, dayStart, rxBytes, txBytes)
}
}
func kickAccount(apiPort int64, trafficStatsSecret string) {