mirror of
https://github.com/rclone/rclone.git
synced 2025-01-10 00:08:44 +01:00
vfs: recommend --vfs-cache-modes writes on backends which can't stream
This commit is contained in:
parent
c4c6a1ee7d
commit
47d08ac1f1
@ -216,7 +216,8 @@ func New(f fs.Fs, opt *vfscommon.Options) *VFS {
|
|||||||
vfs.root = newDir(vfs, f, nil, fsDir)
|
vfs.root = newDir(vfs, f, nil, fsDir)
|
||||||
|
|
||||||
// Start polling function
|
// Start polling function
|
||||||
if do := vfs.f.Features().ChangeNotify; do != nil {
|
features := vfs.f.Features()
|
||||||
|
if do := features.ChangeNotify; do != nil {
|
||||||
vfs.pollChan = make(chan time.Duration)
|
vfs.pollChan = make(chan time.Duration)
|
||||||
do(context.TODO(), vfs.root.changeNotify, vfs.pollChan)
|
do(context.TODO(), vfs.root.changeNotify, vfs.pollChan)
|
||||||
vfs.pollChan <- vfs.Opt.PollInterval
|
vfs.pollChan <- vfs.Opt.PollInterval
|
||||||
@ -224,6 +225,11 @@ func New(f fs.Fs, opt *vfscommon.Options) *VFS {
|
|||||||
fs.Infof(f, "poll-interval is not supported by this remote")
|
fs.Infof(f, "poll-interval is not supported by this remote")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warn if can't stream
|
||||||
|
if !vfs.Opt.ReadOnly && vfs.Opt.CacheMode < vfscommon.CacheModeWrites && features.PutStream == nil {
|
||||||
|
fs.Logf(f, "--vfs-cache-mode writes or full is recommended for this remote as it can't stream")
|
||||||
|
}
|
||||||
|
|
||||||
vfs.SetCacheMode(vfs.Opt.CacheMode)
|
vfs.SetCacheMode(vfs.Opt.CacheMode)
|
||||||
|
|
||||||
// Pin the Fs into the cache so that when we use cache.NewFs
|
// Pin the Fs into the cache so that when we use cache.NewFs
|
||||||
|
Loading…
Reference in New Issue
Block a user