package demo import ( _ "blazing/modules/task/packed" "blazing/cool" _ "blazing/modules/task/controller" _ "blazing/modules/task/funcs" _ "blazing/modules/task/middleware" "blazing/modules/task/model" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gctx" ) func init() { var ( taskInfo = model.NewTaskInfo() ctx = gctx.GetInitCtx() ) g.Log().Debug(ctx, "module task init start ...") cool.FillInitData(ctx, "task", taskInfo) result, err := cool.DBM(taskInfo).Where("status = ?", 1).All() if err != nil { panic(err) } for _, v := range result { id := v["id"].String() cool.RunFunc(ctx, "TaskAddTask("+id+")") } g.Log().Debug(ctx, "module task init finished ...") }