lib/model: Don't update ignore hash when pull fails

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4522
This commit is contained in:
Simon Frei 2017-11-17 12:42:41 +00:00 committed by Jakob Borg
parent 5f4ed66aa1
commit 6cf01c1d30

View File

@ -239,6 +239,11 @@ func (f *sendReceiveFolder) pull(prevIgnoreHash string) (curIgnoreHash string, s
return prevIgnoreHash, true
}
if err := f.CheckHealth(); err != nil {
l.Debugln("Skipping pull of", f.Description(), "due to folder error:", err)
return prevIgnoreHash, true
}
f.model.fmut.RLock()
curIgnores := f.model.folderIgnores[f.folderID]
f.model.fmut.RUnlock()
@ -246,11 +251,6 @@ func (f *sendReceiveFolder) pull(prevIgnoreHash string) (curIgnoreHash string, s
curIgnoreHash = curIgnores.Hash()
ignoresChanged := curIgnoreHash != prevIgnoreHash
if err := f.CheckHealth(); err != nil {
l.Debugln("Skipping pull of", f.Description(), "due to folder error:", err)
return curIgnoreHash, true
}
l.Debugln(f, "pulling")
f.setState(FolderSyncing)
@ -294,7 +294,11 @@ func (f *sendReceiveFolder) pull(prevIgnoreHash string) (curIgnoreHash string, s
f.setState(FolderIdle)
return curIgnoreHash, changed == 0
if changed == 0 {
return curIgnoreHash, true
}
return prevIgnoreHash, false
}
// pullerIteration runs a single puller iteration for the given folder and