cmd/syncthing, lib/config: Remove restartOnWakeup option & functionality (fixes #8448) (#8449)

This commit is contained in:
Jakob Borg
2022-07-26 16:53:10 +02:00
committed by GitHub
parent 1b575b4461
commit a2c5d901f2
6 changed files with 196 additions and 261 deletions
-22
View File
@@ -663,8 +663,6 @@ func syncthingMain(options serveOptions) {
}
}
go standbyMonitor(app, cfgWrapper)
if err := app.Start(); err != nil {
os.Exit(svcutil.ExitError.AsInt())
}
@@ -761,26 +759,6 @@ func resetDB() error {
return os.RemoveAll(locations.Get(locations.Database))
}
func standbyMonitor(app *syncthing.App, cfg config.Wrapper) {
restartDelay := 60 * time.Second
now := time.Now()
for {
time.Sleep(10 * time.Second)
if time.Since(now) > 2*time.Minute && cfg.Options().RestartOnWakeup {
l.Infof("Paused state detected, possibly woke up from standby. Restarting in %v.", restartDelay)
// We most likely just woke from standby. If we restart
// immediately chances are we won't have networking ready. Give
// things a moment to stabilize.
time.Sleep(restartDelay)
app.Stop(svcutil.ExitRestart)
return
}
now = time.Now()
}
}
func autoUpgradePossible(options serveOptions) bool {
if upgrade.DisabledByCompilation {
return false