enterprise/worker/worker.go

16 lines
281 B
Go
Raw Normal View History

2023-08-04 11:13:41 +08:00
package worker
2023-08-04 18:27:37 +08:00
import (
"github.com/go-co-op/gocron"
"time"
)
2023-08-04 11:13:41 +08:00
func Init() error {
2023-08-04 18:27:37 +08:00
timezone, _ := time.LoadLocation("Asia/Shanghai")
cron := gocron.NewScheduler(timezone)
cron.Every(10).Minute().Do(func() {
go SyncCheckin(time.Now().Format("2006-01-02"))
})
2023-08-04 11:13:41 +08:00
return nil
}