模块化定时任务,方便在插件中注册任务;增加日志分组

This commit is contained in:
孟帅
2023-06-05 20:14:57 +08:00
parent 62ecbb7f26
commit 48f8c20d9c
79 changed files with 820 additions and 783 deletions

View File

@@ -11,11 +11,12 @@ import (
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/internal/dao"
"hotgo/internal/library/cron"
"hotgo/internal/service"
)
func init() {
cronList = append(cronList, CloseOrder)
cron.Register(CloseOrder)
}
// CloseOrder 取消过期订单
@@ -38,6 +39,6 @@ func (c *cCloseOrder) Execute(ctx context.Context) {
dao.AdminOrder.Columns().Status: consts.OrderStatusClose,
}).Update()
if err != nil {
g.Log().Warning(ctx, "cron CloseOrder Execute err:%+v", err)
cron.Logger().Warning(ctx, "cron CloseOrder Execute err:%+v", err)
}
}