From 85dba2524641ae6f115809b5dc0f5725f9c3a20c Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 10 Sep 2014 22:20:03 +0200 Subject: [PATCH] Add pause before restart after standby --- cmd/syncthing/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index dd162a388..fc5249349 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -1130,7 +1130,14 @@ func standbyMonitor() { time.Sleep(10 * time.Second) if time.Since(now) > 2*time.Minute { l.Infoln("Paused state detected, possibly woke up from standby.") + + // 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(10 * time.Second) + restart() + return } now = time.Now() }