mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
vfs: re-use the File objects when re-reading the directory
Make it so that d.items is never nil to simplify the code This should help with inconsistent reads when the source object changes.
This commit is contained in:
@@ -252,6 +252,14 @@ func (f *File) setObject(o fs.Object) {
|
||||
f.d.addObject(f)
|
||||
}
|
||||
|
||||
// Update the object but don't update the directory cache - for use by
|
||||
// the directory cache
|
||||
func (f *File) setObjectNoUpdate(o fs.Object) {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
f.o = o
|
||||
}
|
||||
|
||||
// Get the current fs.Object - may be nil
|
||||
func (f *File) getObject() fs.Object {
|
||||
f.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user