:arrow_up:升级依赖以及添加一些环境变量
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
@@ -3,11 +3,16 @@ package cron
|
||||
import (
|
||||
"gitee.ltd/lxh/logger/log"
|
||||
"github.com/go-co-op/gocron/v2"
|
||||
"github.com/spf13/cast"
|
||||
"os"
|
||||
"time"
|
||||
"wireguard-ui/cron/task"
|
||||
)
|
||||
|
||||
func Task() {
|
||||
if !cast.ToBool(os.Getenv("ENABLED_CRON")) {
|
||||
return
|
||||
}
|
||||
sch, err := gocron.NewScheduler(gocron.WithLocation(time.Local))
|
||||
if err != nil {
|
||||
log.Errorf("初始化定时任务失败")
|
||||
|
||||
Reference in New Issue
Block a user