Handle daemon mode before creating the app config

Daemon mode doesn't have any reason to read the user config or try to
migrate it if it's old.
This commit is contained in:
Stefan Haller 2026-09-07 07:27:59 +02:00
parent 37893d2b8e
commit 2f1301bd7d

View file

@ -97,6 +97,11 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
// CONFIG_DIR env var above.
logger := NewLogger(cliArgs.Debug)
if daemon.InDaemonMode() {
daemon.Handle(logger)
return
}
if cliArgs.PrintVersionInfo {
gitVersion := getGitVersionInfo()
fmt.Printf("commit=%s, build date=%s, build source=%s, version=%s, os=%s, arch=%s, git version=%s\n", buildInfo.Commit, buildInfo.Date, buildInfo.BuildSource, buildInfo.Version, runtime.GOOS, runtime.GOARCH, gitVersion)
@ -163,11 +168,6 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
log.Fatal(err)
}
if daemon.InDaemonMode() {
daemon.Handle(common.Log)
return
}
if cliArgs.Profile {
go func() {
if err := http.ListenAndServe("localhost:6060", nil); err != nil {