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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -344,6 +344,9 @@ func (f *folder) pull() (success bool) {
return false
}
// 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 {
@ -351,6 +354,7 @@ func (f *folder) pull() (success bool) {
return true
}
defer f.ioLimiter.give(1)
}
startTime := time.Now()

View File

@ -40,13 +40,6 @@ func (f *sendOnlyFolder) PullErrors() []FileError {
// pull checks need for files that only differ by metadata (no changes on disk)
func (f *sendOnlyFolder) pull() bool {
select {
case <-f.initialScanFinished:
default:
// Once the initial scan finished, a pull will be scheduled
return false
}
batch := make([]protocol.FileInfo, 0, maxBatchSizeFiles)
batchSizeBytes := 0