mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
lib/model: Don't acquire I/O token for send-only pull (#6951)
This commit is contained in:
parent
e3e46ec1de
commit
6365e6108f
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user