This commit is contained in:
Mrx
2026-06-06 17:03:08 +08:00
parent a85436950e
commit 35e9191981
28 changed files with 666 additions and 286 deletions

View File

@@ -48,12 +48,12 @@ func main() {
asynq := queue.NewCronJob(ctx, svcContext)
mux := asynq.Register()
// 启动 asynq 消费者
// Run 会阻塞;成功日志必须在 Run 之前打印
fmt.Println("异步任务启动!!!")
if err := svcContext.AsynqServer.Run(mux); err != nil {
logx.WithContext(ctx).Errorf("异步任务启动失败: %v", err)
os.Exit(1)
}
fmt.Println("异步任务启动!!!")
}()
server := rest.MustNewServer(c.RestConf)