1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

vfs: stop change notify polling clearing so much of the directory cache

Before this change, change notify polls would clear the directory
cache recursively. So uploading a file to the root would clear the
entire directory cache.

After this change we just invalidate the directory cache of the parent
directory of the item and if the item was a directory we invalidate it
too.
This commit is contained in:
Nick Craig-Wood
2019-10-17 14:41:55 +01:00
parent 2bbfcc74e9
commit 76f5e273d2
2 changed files with 30 additions and 15 deletions

View File

@@ -232,7 +232,7 @@ func New(f fs.Fs, opt *Options) *VFS {
// Start polling function
if do := vfs.f.Features().ChangeNotify; do != nil {
vfs.pollChan = make(chan time.Duration)
do(context.TODO(), vfs.root.ForgetPath, vfs.pollChan)
do(context.TODO(), vfs.root.changeNotify, vfs.pollChan)
vfs.pollChan <- vfs.Opt.PollInterval
} else {
fs.Infof(f, "poll-interval is not supported by this remote")