lib/model: Don't acquire I/O token for send-only pull (#6951)

This commit is contained in:
Simon Frei
2020-09-03 13:59:45 +02:00
committed by GitHub
parent e3e46ec1de
commit 6365e6108f
2 changed files with 9 additions and 12 deletions
+9 -5
View File
@@ -344,13 +344,17 @@ func (f *folder) pull() (success bool) {
return false
}
f.setState(FolderSyncWaiting)
// Send only folder doesn't do any io, it only checks for out-of-sync
// items that differ in metadata and updates those.
if f.Type != config.FolderTypeSendOnly {
f.setState(FolderSyncWaiting)
if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil {
f.setError(err)
return true
if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil {
f.setError(err)
return true
}
defer f.ioLimiter.give(1)
}
defer f.ioLimiter.give(1)
startTime := time.Now()