diff --git a/lib/model/folder.go b/lib/model/folder.go index f3874edc2..ce7459e9f 100644 --- a/lib/model/folder.go +++ b/lib/model/folder.go @@ -40,6 +40,7 @@ func newFolder(model *Model, cfg config.FolderConfiguration) folder { cancel: cancel, model: model, initialScanFinished: make(chan struct{}), + watchCancel: func() {}, } } diff --git a/lib/model/rofolder.go b/lib/model/rofolder.go index 7a665776e..b7a567102 100644 --- a/lib/model/rofolder.go +++ b/lib/model/rofolder.go @@ -34,7 +34,7 @@ func (f *sendOnlyFolder) Serve() { f.scan.timer.Stop() }() - if f.FSWatcherEnabled { + if f.FSWatcherEnabled && f.CheckHealth() == nil { f.startWatch() } diff --git a/lib/model/rwfolder.go b/lib/model/rwfolder.go index 793d6448b..e524354f5 100644 --- a/lib/model/rwfolder.go +++ b/lib/model/rwfolder.go @@ -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() }