mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-14 01:04:14 +00:00
lib/model: Check availability later to catch renames (#5097)
This commit is contained in:
parent
9028969617
commit
ff3cbdc90d
@ -282,7 +282,7 @@ func (l FolderDeviceConfigurationList) Len() int {
|
|||||||
return len(l)
|
return len(l)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FolderConfiguration) CheckFreeSpace() (err error) {
|
func (f *FolderConfiguration) CheckFreeSpace() error {
|
||||||
return checkFreeSpace(f.MinDiskFree, f.Filesystem())
|
return checkFreeSpace(f.MinDiskFree, f.Filesystem())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,18 +349,8 @@ func (f *sendReceiveFolder) processNeeded(ignores *ignore.Matcher, folderFiles *
|
|||||||
changed++
|
changed++
|
||||||
|
|
||||||
case file.Type == protocol.FileInfoTypeFile:
|
case file.Type == protocol.FileInfoTypeFile:
|
||||||
// Queue files for processing after directories and symlinks, if
|
// Queue files for processing after directories and symlinks.
|
||||||
// it has availability.
|
|
||||||
|
|
||||||
devices := folderFiles.Availability(file.Name)
|
|
||||||
for _, dev := range devices {
|
|
||||||
if _, ok := f.model.Connection(dev); ok {
|
|
||||||
f.queue.Push(file.Name, file.Size, file.ModTime())
|
f.queue.Push(file.Name, file.Size, file.ModTime())
|
||||||
changed++
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
f.newError("pull", file.Name, errNotAvailable)
|
|
||||||
|
|
||||||
case runtime.GOOS == "windows" && file.IsSymlink():
|
case runtime.GOOS == "windows" && file.IsSymlink():
|
||||||
file.SetUnsupported(f.shortID)
|
file.SetUnsupported(f.shortID)
|
||||||
@ -492,8 +482,16 @@ nextFile:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
devices := folderFiles.Availability(fileName)
|
||||||
|
for _, dev := range devices {
|
||||||
|
if _, ok := f.model.Connection(dev); ok {
|
||||||
|
changed++
|
||||||
// Handle the file normally, by coping and pulling, etc.
|
// Handle the file normally, by coping and pulling, etc.
|
||||||
f.handleFile(fi, copyChan, finisherChan, dbUpdateChan)
|
f.handleFile(fi, copyChan, finisherChan, dbUpdateChan)
|
||||||
|
continue nextFile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
f.newError("pull", fileName, errNotAvailable)
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed, fileDeletions, dirDeletions, nil
|
return changed, fileDeletions, dirDeletions, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user