Add debug server flag and run it in main
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Melody Becker 2025-04-07 17:43:05 +02:00
parent 59b2bc0deb
commit 954e4c5a34
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
2 changed files with 14 additions and 1 deletions

View file

@ -20,6 +20,7 @@ import (
storagenew "git.mstar.dev/mstar/linstrom/storage-new"
"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
"git.mstar.dev/mstar/linstrom/storage/cache"
webdebug "git.mstar.dev/mstar/linstrom/web/debug"
)
// TODO: Add frontend overwrite
@ -124,4 +125,11 @@ func newServer() {
if err = storagenew.InsertSelf(); err != nil {
log.Fatal().Err(err).Msg("Failed to insert self properly")
}
if *shared.FlagStartDebugServer {
log.Info().Msg("Starting debug server")
// TODO: Move into goroutine once public server also exists
if err = webdebug.New().Start(); err != nil {
log.Fatal().Err(err).Msg("Debug server failed")
}
}
}

View file

@ -19,7 +19,12 @@ var (
false,
"If set, the server will only validate the config (or write the default one) and then quit",
)
FlagStartNew *bool = flag.Bool("new", false, "Start the new system")
FlagStartNew *bool = flag.Bool("new", false, "Start the new system")
FlagStartDebugServer *bool = flag.Bool(
"debugserver",
false,
"Also start the local debugging server",
)
)
func flagUsage() {