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
@@ -5,6 +5,7 @@
package cmd
import (
"github.com/Rain-kl/Wavelet/internal/bootstrap"
"github.com/Rain-kl/Wavelet/internal/router"
"github.com/spf13/cobra"
)
@@ -13,6 +14,8 @@ var apiCmd = &cobra.Command{
Use: "api",
Short: "wavelet API",
Run: func(_ *cobra.Command, _ []string) {
bootstrap.RegisterAPI()
runBootstrap(bootstrap.Options{API: true})
router.Serve()
},
}