refactor(bootstrap): move runtime init from router to cmd layer

Extract SyncEvents and InitLogWriter from router.Serve into bootstrap.Init
called from cmd entry points with trace-aware context. Preserve existing
Register* wiring for task and push domain integrations.
This commit is contained in:
ryan
2026-06-18 10:38:08 +08:00
parent 50c45db561
commit 03fa5d948d
9 changed files with 152 additions and 15 deletions
+3
View File
@@ -9,6 +9,7 @@ import (
"log"
"sync"
"github.com/Rain-kl/Wavelet/internal/bootstrap"
"github.com/Rain-kl/Wavelet/internal/router"
"github.com/Rain-kl/Wavelet/internal/task/scheduler"
"github.com/Rain-kl/Wavelet/internal/task/worker"
@@ -20,6 +21,8 @@ var allCmd = &cobra.Command{
Short: "以融合模式同时启动 API、Worker 和 Scheduler",
Run: func(_ *cobra.Command, _ []string) {
log.Println("[All] 融合模式启动")
bootstrap.RegisterAll()
runBootstrap(bootstrap.Options{API: true})
var wg sync.WaitGroup