This commit is contained in:
+23
-1
@@ -334,16 +334,38 @@ func (f *folder) pull() (success bool) {
|
|||||||
return true
|
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)
|
f.setState(FolderSyncWaiting)
|
||||||
defer f.setState(FolderIdle)
|
|
||||||
|
|
||||||
if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil {
|
if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil {
|
||||||
|
f.setError(err)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
defer f.ioLimiter.give(1)
|
defer f.ioLimiter.give(1)
|
||||||
|
|
||||||
startTime := time.Now()
|
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()
|
success = f.puller.pull()
|
||||||
|
|
||||||
if success {
|
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
|
// pull returns true if it manages to get all needed items from peers, i.e. get
|
||||||
// the device in sync with the global state.
|
// the device in sync with the global state.
|
||||||
func (f *sendReceiveFolder) pull() bool {
|
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)
|
l.Debugf("%v pulling", f)
|
||||||
|
|
||||||
scanChan := make(chan string)
|
scanChan := make(chan string)
|
||||||
|
|||||||
Reference in New Issue
Block a user