lib/model: Add initial noop watch cancel func (fixes #4464)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4465
This commit is contained in:
Simon Frei 2017-10-26 11:49:06 +00:00 committed by Jakob Borg
parent ff0a83fe5b
commit 2953fe40d1
3 changed files with 3 additions and 2 deletions

View File

@ -40,6 +40,7 @@ func newFolder(model *Model, cfg config.FolderConfiguration) folder {
cancel: cancel,
model: model,
initialScanFinished: make(chan struct{}),
watchCancel: func() {},
}
}

View File

@ -34,7 +34,7 @@ func (f *sendOnlyFolder) Serve() {
f.scan.timer.Stop()
}()
if f.FSWatcherEnabled {
if f.FSWatcherEnabled && f.CheckHealth() == nil {
f.startWatch()
}

View File

@ -164,7 +164,7 @@ func (f *sendReceiveFolder) Serve() {
var prevSec int64
var prevIgnoreHash string
if f.FSWatcherEnabled {
if f.FSWatcherEnabled && f.CheckHealth() == nil {
f.startWatch()
}