mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
This commit is contained in:
parent
850dd4cd25
commit
a85bc1c3a6
@ -334,16 +334,38 @@ func (f *folder) pull() (success bool) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Abort early (before acquiring a token) if there's a folder error
|
||||
err := f.getHealthErrorWithoutIgnores()
|
||||
f.setError(err)
|
||||
if err != nil {
|
||||
l.Debugln("Skipping pull of", f.Description(), "due to folder error:", err)
|
||||
return false
|
||||
}
|
||||
|
||||
f.setState(FolderSyncWaiting)
|
||||
defer f.setState(FolderIdle)
|
||||
|
||||
if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil {
|
||||
f.setError(err)
|
||||
return true
|
||||
}
|
||||
defer f.ioLimiter.give(1)
|
||||
|
||||
startTime := time.Now()
|
||||
|
||||
// Check if the ignore patterns changed.
|
||||
oldHash := f.ignores.Hash()
|
||||
defer func() {
|
||||
if f.ignores.Hash() != oldHash {
|
||||
f.ignoresUpdated()
|
||||
}
|
||||
}()
|
||||
err = f.getHealthErrorAndLoadIgnores()
|
||||
f.setError(err)
|
||||
if err != nil {
|
||||
l.Debugln("Skipping pull of", f.Description(), "due to folder error:", err)
|
||||
return false
|
||||
}
|
||||
|
||||
success = f.puller.pull()
|
||||
|
||||
if success {
|
||||
|
@ -166,20 +166,6 @@ func newSendReceiveFolder(model *model, fset *db.FileSet, ignores *ignore.Matche
|
||||
// pull returns true if it manages to get all needed items from peers, i.e. get
|
||||
// the device in sync with the global state.
|
||||
func (f *sendReceiveFolder) pull() bool {
|
||||
// Check if the ignore patterns changed.
|
||||
oldHash := f.ignores.Hash()
|
||||
defer func() {
|
||||
if f.ignores.Hash() != oldHash {
|
||||
f.ignoresUpdated()
|
||||
}
|
||||
}()
|
||||
err := f.getHealthErrorAndLoadIgnores()
|
||||
f.setError(err)
|
||||
if err != nil {
|
||||
l.Debugln("Skipping pull of", f.Description(), "due to folder error:", err)
|
||||
return false
|
||||
}
|
||||
|
||||
l.Debugf("%v pulling", f)
|
||||
|
||||
scanChan := make(chan string)
|
||||
|
Loading…
Reference in New Issue
Block a user