Files
kami_backend/utility/cron/cron.go
sunxiaolong 0dbace1e5d 🐛 修正之前的错误,添加订单什么的
🐛 修正url链接的问题

🐛 修正url链接的问题

🐛 修正url链接的问题
2024-06-02 22:30:07 +08:00

19 lines
466 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)
})
}