This commit is contained in:
jiangyong27 2023-09-04 22:25:04 +08:00
parent c4570ee30b
commit f6d0700068
1 changed files with 2 additions and 2 deletions

View File

@ -16,14 +16,14 @@ func Init1() error {
func Init() error { func Init() error {
timezone, _ := time.LoadLocation("Asia/Shanghai") timezone, _ := time.LoadLocation("Asia/Shanghai")
cron := gocron.NewScheduler(timezone) cron := gocron.NewScheduler(timezone)
cron.Every(5).Minute().Do(func() { cron.Every(10).Minute().Do(func() {
go SyncCheckin(time.Now().Format("2006-01-02")) go SyncCheckin(time.Now().Format("2006-01-02"))
}) })
cron.Every(1).Day().At("03:00").Do(func() { cron.Every(1).Day().At("03:00").Do(func() {
go SyncStaffInfo() go SyncStaffInfo()
}) })
cron.Every(1).Month(1, 2, 3, 4, 5).At("02:00").Do(func() { cron.Every(1).Month(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).At("02:00").Do(func() {
go SyncStaffSalary("") go SyncStaffSalary("")
}) })
cron.StartAsync() cron.StartAsync()