This commit is contained in:
jiangyong27 2023-08-04 18:47:12 +08:00
parent 810da6a9af
commit f2db7ceacf
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ type Checkin struct {
Id int64
UserId string
Day string
Exception string
StartTime int64
EndTime int64
CreateTime int64

View File

@ -8,8 +8,10 @@ import (
func Init() error {
timezone, _ := time.LoadLocation("Asia/Shanghai")
cron := gocron.NewScheduler(timezone)
cron.Every(10).Minute().Do(func() {
cron.Every(5).Minute().Do(func() {
go SyncCheckin(time.Now().Format("2006-01-02"))
})
cron.StartAsync()
return nil
}