fix: add new crontask module
This commit is contained in:
23
src/modules/crontask/crontask.go
Normal file
23
src/modules/crontask/crontask.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user