mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 09:32:29 +08: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)
|
||||
|
||||
// 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)
|
||||
do(context.TODO(), vfs.root.changeNotify, vfs.pollChan)
|
||||
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")
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
// Pin the Fs into the cache so that when we use cache.NewFs
|
||||
|
|
Loading…
Reference in New Issue
Block a user