|
@@ -20,12 +20,16 @@ func NewPeriodicTrafficResetJob(period Period) *PeriodicTrafficResetJob {
|
|
|
|
|
|
func (j *PeriodicTrafficResetJob) Run() {
|
|
func (j *PeriodicTrafficResetJob) Run() {
|
|
inbounds, err := j.inboundService.GetInboundsByTrafficReset(string(j.period))
|
|
inbounds, err := j.inboundService.GetInboundsByTrafficReset(string(j.period))
|
|
- logger.Infof("Running periodic traffic reset job for period: %s", j.period)
|
|
|
|
if err != nil {
|
|
if err != nil {
|
|
logger.Warning("Failed to get inbounds for traffic reset:", err)
|
|
logger.Warning("Failed to get inbounds for traffic reset:", err)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if len(inbounds) == 0 {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ logger.Infof("Running periodic traffic reset job for period: %s (%d matching inbounds)", j.period, len(inbounds))
|
|
|
|
+
|
|
resetCount := 0
|
|
resetCount := 0
|
|
|
|
|
|
for _, inbound := range inbounds {
|
|
for _, inbound := range inbounds {
|