fix(cmd): only start temporary API server during migration if it's enabled (#10284)

This commit is contained in:
Tommy van der Vorst
2025-08-25 05:46:23 +00:00
committed by GitHub
parent 07f1320e00
commit 958f51ace6
2 changed files with 12 additions and 5 deletions
+5 -1
View File
@@ -479,7 +479,11 @@ func (c *serveCmd) syncthingMain() {
})
}
if err := syncthing.TryMigrateDatabase(ctx, c.DBDeleteRetentionInterval, cfgWrapper.GUI().Address()); err != nil {
var tempApiAddress string
if cfgWrapper.GUI().Enabled {
tempApiAddress = cfgWrapper.GUI().Address()
}
if err := syncthing.TryMigrateDatabase(ctx, c.DBDeleteRetentionInterval, tempApiAddress); err != nil {
slog.Error("Failed to migrate old-style database", slogutil.Error(err))
os.Exit(1)
}