Merge pull request #571 from syncthing/recheck
Add routine for checking possible standby (fixes #565)
This commit is contained in:
commit
91ba93bd7a
|
@ -559,6 +559,8 @@ nextRepo:
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go standbyMonitor()
|
||||||
|
|
||||||
events.Default.Log(events.StartupComplete, nil)
|
events.Default.Log(events.StartupComplete, nil)
|
||||||
go generateEvents()
|
go generateEvents()
|
||||||
|
|
||||||
|
@ -1164,3 +1166,15 @@ func overrideGUIConfig(originalCfg config.GUIConfiguration, address, authenticat
|
||||||
}
|
}
|
||||||
return cfg
|
return cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func standbyMonitor() {
|
||||||
|
now := time.Now()
|
||||||
|
for {
|
||||||
|
time.Sleep(10 * time.Second)
|
||||||
|
if time.Since(now) > 2*time.Minute {
|
||||||
|
l.Infoln("Paused state detected, possibly woke up from standby.")
|
||||||
|
restart()
|
||||||
|
}
|
||||||
|
now = time.Now()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user