fix: add new crontask module

This commit is contained in:
2023-10-21 16:15:08 +08:00
parent bdc6fdaa89
commit 7ddc5fa937
7 changed files with 238 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
package crontask
import (
"ems.agt/src/framework/cron"
"ems.agt/src/framework/logger"
"ems.agt/src/modules/crontask/tasks"
"github.com/gin-gonic/gin"
)
// Setup 模块路由注册
func Setup(router *gin.Engine) {
logger.Infof("开始加载 ====> monitor 模块路由")
// 启动时需要的初始参数
InitCronQueue()
}
// InitCronQueue 初始定时任务队列
func InitCronQueue() {
cron.CreateQueue("tasks", tasks.NewProcessor)
}