Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/web.go')
-rw-r--r--web/web.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/web.go b/web/web.go
index cfd4de5f..d381539d 100644
--- a/web/web.go
+++ b/web/web.go
@@ -289,6 +289,19 @@ func (s *Server) startTask() {
// check client ips from log file every day
s.cron.AddJob("@daily", job.NewClearLogsJob())
+ // Periodic traffic resets
+ logger.Info("Scheduling periodic traffic reset jobs")
+ {
+ // Inbound traffic reset jobs
+ // Run once a day, midnight
+ s.cron.AddJob("@daily", job.NewPeriodicTrafficResetJob("daily"))
+ // Run once a week, midnight between Sat/Sun
+ s.cron.AddJob("@weekly", job.NewPeriodicTrafficResetJob("weekly"))
+ // Run once a month, midnight, first of month
+ s.cron.AddJob("@monthly", job.NewPeriodicTrafficResetJob("monthly"))
+
+ }
+
// Make a traffic condition every day, 8:30
var entry cron.EntryID
isTgbotenabled, err := s.settingService.GetTgbotEnabled()