lib/model, lib/config: Refactor folder health/error handling (fixes #4445, fixes #4451)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4455
LGTM: AudriusButkevicius, calmh
This commit is contained in:
Simon Frei
2017-10-24 07:58:55 +00:00
committed by Jakob Borg
parent a9c221189b
commit dc42db444b
9 changed files with 207 additions and 218 deletions

View File

@@ -35,7 +35,7 @@ func (f *sendOnlyFolder) Serve() {
}()
if f.FSWatcherEnabled {
f.startWatcher()
f.startWatch()
}
for {
@@ -43,10 +43,8 @@ func (f *sendOnlyFolder) Serve() {
case <-f.ctx.Done():
return
case <-f.ignoresUpdated:
if f.FSWatcherEnabled {
f.restartWatcher()
}
case <-f.restartWatchChan:
f.restartWatch()
case <-f.scan.timer.C:
l.Debugln(f, "Scanning subdirectories")