chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)

This commit is contained in:
MiFaZhan
2026-11-02 13:27:59 +08:00
1250 changed files with 154111 additions and 0 deletions
@@ -0,0 +1,25 @@
package tasks
import (
"context"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
"time"
)
const (
trafficCutoffJobPeriod = 15 * time.Minute
trafficCutoffJobTTL = 45 * time.Minute
)
func init() {
RegisterInnerTask("check_traffic_cutoff", "CheckTrafficCutoff")
RegisterInnerTask("CheckTrafficCutoff", "CheckTrafficCutoff")
}
func (t Task) CheckTrafficCutoff() {
t.runWithRedisJobLock(context.Background(), redisJobLockOptions{
InvokeTarget: "check_traffic_cutoff",
Period: trafficCutoffJobPeriod,
TTL: trafficCutoffJobTTL,
}, service.TrafficCutoff().Check)
}