GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4455 LGTM: AudriusButkevicius, calmh
This commit is contained in:
@@ -165,7 +165,7 @@ func (f *sendReceiveFolder) Serve() {
|
||||
var prevIgnoreHash string
|
||||
|
||||
if f.FSWatcherEnabled {
|
||||
f.startWatcher()
|
||||
f.startWatch()
|
||||
}
|
||||
|
||||
for {
|
||||
@@ -178,12 +178,6 @@ func (f *sendReceiveFolder) Serve() {
|
||||
f.pullTimer.Reset(0)
|
||||
l.Debugln(f, "remote index updated, rescheduling pull")
|
||||
|
||||
case <-f.ignoresUpdated:
|
||||
if f.FSWatcherEnabled {
|
||||
f.restartWatcher()
|
||||
}
|
||||
f.IndexUpdated()
|
||||
|
||||
case <-f.pullTimer.C:
|
||||
select {
|
||||
case <-f.initialScanFinished:
|
||||
@@ -214,8 +208,8 @@ func (f *sendReceiveFolder) Serve() {
|
||||
continue
|
||||
}
|
||||
|
||||
if err := f.model.CheckFolderHealth(f.folderID); err != nil {
|
||||
l.Infoln("Skipping pull of", f.Description(), "due to folder error:", err)
|
||||
if err := f.CheckHealth(); err != nil {
|
||||
l.Debugln("Skipping pull of", f.Description(), "due to folder error:", err)
|
||||
f.pullTimer.Reset(f.sleep)
|
||||
continue
|
||||
}
|
||||
@@ -292,6 +286,9 @@ func (f *sendReceiveFolder) Serve() {
|
||||
case fsEvents := <-f.watchChan:
|
||||
l.Debugln(f, "filesystem notification rescan")
|
||||
f.scanSubdirs(fsEvents)
|
||||
|
||||
case <-f.restartWatchChan:
|
||||
f.restartWatch()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1696,6 +1693,11 @@ func (f *sendReceiveFolder) currentErrors() []fileError {
|
||||
return errors
|
||||
}
|
||||
|
||||
func (f *sendReceiveFolder) IgnoresUpdated() {
|
||||
f.folder.IgnoresUpdated()
|
||||
f.IndexUpdated()
|
||||
}
|
||||
|
||||
// A []fileError is sent as part of an event and will be JSON serialized.
|
||||
type fileError struct {
|
||||
Path string `json:"path"`
|
||||
|
||||
Reference in New Issue
Block a user