mirror of https://github.com/rclone/rclone.git
vfs: fix inefficient directory caching when directory reads are slow
Before this change, when querying directories with large datasets, if the query duration exceeded the directory cache expiration time, the cache became invalid by the time results were retrieved. This means every execution of `_readDir` triggers `_readDirFromEntries`, resulting in prolonged processing times. After this change we update the directory time with the time at the end of the query.
This commit is contained in:
parent
a5d03e0ada
commit
49f6ed5f5e
|
@ -581,7 +581,7 @@ func (d *Dir) _readDir() error {
|
|||
return err
|
||||
}
|
||||
|
||||
d.read = when
|
||||
d.read = time.Now()
|
||||
d.cleanupTimer.Reset(time.Duration(d.vfs.Opt.DirCacheTime * 2))
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue