### Purpose As discussed in #9686 Syncthing currently does not check folderstate on remote device before pulling. If no devices have a valid folderstate (i.e all devices have the folder paused) it will still attempt to pull. On large folders this will cause a hanging "Syncing" status. This checks whether at least one connected device has the file available and has a valid folderstate. ### Testing Tested locally on multiple devices. We're new to Go (all our stuff is Python) so please bear with! Interested if there may be a better place to slot this in. Thanks, Jon --------- Co-authored-by: Simon Frei <freisim93@gmail.com>
This commit is contained in:
@@ -505,13 +505,10 @@ nextFile:
|
||||
continue nextFile
|
||||
}
|
||||
|
||||
devices := snap.Availability(fileName)
|
||||
for _, dev := range devices {
|
||||
if f.model.ConnectedTo(dev) {
|
||||
// Handle the file normally, by copying and pulling, etc.
|
||||
f.handleFile(fi, snap, copyChan)
|
||||
continue nextFile
|
||||
}
|
||||
devices := f.model.fileAvailability(f.FolderConfiguration, snap, fi)
|
||||
if len(devices) > 0 {
|
||||
f.handleFile(fi, snap, copyChan)
|
||||
continue
|
||||
}
|
||||
f.newPullError(fileName, errNotAvailable)
|
||||
f.queue.Done(fileName)
|
||||
@@ -1547,7 +1544,7 @@ func (f *sendReceiveFolder) pullBlock(state pullBlockState, snap *db.Snapshot, o
|
||||
}
|
||||
|
||||
var lastError error
|
||||
candidates := f.model.availabilityInSnapshot(f.FolderConfiguration, snap, state.file, state.block)
|
||||
candidates := f.model.blockAvailability(f.FolderConfiguration, snap, state.file, state.block)
|
||||
loop:
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user