disable traffic charts if set to zero

This commit is contained in:
Alireza Ahmadi
2025-08-30 02:11:43 +02:00
parent e3c33bf649
commit 560c41acbe
5 changed files with 27 additions and 8 deletions
+6 -3
View File
@@ -7,14 +7,17 @@ import (
type StatsJob struct {
service.StatsService
enableTraffic bool
}
func NewStatsJob() *StatsJob {
return &StatsJob{}
func NewStatsJob(saveTraffic bool) *StatsJob {
return &StatsJob{
enableTraffic: saveTraffic,
}
}
func (s *StatsJob) Run() {
err := s.StatsService.SaveStats()
err := s.StatsService.SaveStats(s.enableTraffic)
if err != nil {
logger.Warning("Get stats failed: ", err)
return