19 lines
466 B
Go
19 lines
466 B
Go
package cron
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/os/gcron"
|
||
"github.com/gogf/gf/v2/os/glog"
|
||
"golang.org/x/net/context"
|
||
"kami/internal/service"
|
||
)
|
||
|
||
// RegisterCron 注册定时任务
|
||
func RegisterCron(ctx context.Context) {
|
||
//每日0时执行
|
||
_, _ = gcron.Add(ctx, "0 0 0 * * ?", func(ctx context.Context) {
|
||
glog.Info(ctx, "每日0时执行,重置苹果账户状态")
|
||
accountService := service.AppleAccount()
|
||
_ = accountService.ResetAccountStatus(ctx)
|
||
})
|
||
}
|