1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00
1Panel/core/init/cron/cron.go
ssongliu a627aa9915
feat: merge from dev (#7366)
* feat: merge from dev

* feat: Merge mobile style code from the dev branch
2024-12-17 15:59:21 +08:00

19 lines
498 B
Go

package cron
import (
"time"
"github.com/1Panel-dev/1Panel/core/app/service"
"github.com/1Panel-dev/1Panel/core/global"
"github.com/1Panel-dev/1Panel/core/utils/common"
"github.com/robfig/cron/v3"
)
func Init() {
nyc, _ := time.LoadLocation(common.LoadTimeZoneByCmd())
global.Cron = cron.New(cron.WithLocation(nyc), cron.WithChain(cron.Recover(cron.DefaultLogger)), cron.WithChain(cron.DelayIfStillRunning(cron.DefaultLogger)))
_ = service.StartRefreshForToken()
global.Cron.Start()
}