all: Make config.Wrapper an actual suture.Service (fixes #7451) (#7452)

This commit is contained in:
Jakob Borg
2021-03-11 14:51:00 +01:00
committed by GitHub
parent df08984a58
commit cdef503db6
8 changed files with 89 additions and 31 deletions
+1
View File
@@ -186,6 +186,7 @@ func main() {
}
wrapper := config.Wrap("config", config.New(id), id, events.NoopLogger)
go wrapper.Serve(context.TODO())
wrapper.Modify(func(cfg *config.Configuration) {
cfg.Options.NATLeaseM = natLease
cfg.Options.NATRenewalM = natRenewal
+1 -3
View File
@@ -603,9 +603,7 @@ func syncthingMain(options serveOptions) {
l.Warnln("Failed to initialize config:", err)
os.Exit(svcutil.ExitError.AsInt())
}
if cfgService, ok := cfgWrapper.(suture.Service); ok {
earlyService.Add(cfgService)
}
earlyService.Add(cfgWrapper)
// Candidate builds should auto upgrade. Make sure the option is set,
// unless we are in a build where it's disabled or the STNOUPGRADE