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:
-rw-r--r--web/job/periodic_traffic_reset_job.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/web/job/periodic_traffic_reset_job.go b/web/job/periodic_traffic_reset_job.go
index 6a370a51..6a7fb6f2 100644
--- a/web/job/periodic_traffic_reset_job.go
+++ b/web/job/periodic_traffic_reset_job.go
@@ -37,13 +37,19 @@ func (j *PeriodicTrafficResetJob) Run() {
resetCount := 0
for _, inbound := range inbounds {
- if err := j.inboundService.ResetAllClientTraffics(inbound.Id); err != nil {
- logger.Warning("Failed to reset traffic for inbound", inbound.Id, ":", err)
- continue
+ resetInboundErr := j.inboundService.ResetAllTraffics()
+ if resetInboundErr != nil {
+ logger.Warning("Failed to reset traffic for inbound", inbound.Id, ":", resetInboundErr)
}
- resetCount++
- logger.Infof("Reset traffic for inbound %d (%s)", inbound.Id, inbound.Remark)
+ resetClientErr := j.inboundService.ResetAllClientTraffics(inbound.Id)
+ if resetClientErr != nil {
+ logger.Warning("Failed to reset traffic for all users of inbound", inbound.Id, ":", resetClientErr)
+ }
+
+ if resetInboundErr == nil && resetClientErr == nil {
+ resetCount++
+ }
}
if resetCount > 0 {