mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +01:00
cachestats: Fix nil pointer if not a cache remote - fixes #1855
Also don't retry or show stats
This commit is contained in:
parent
6448c445f5
commit
1248beb0b2
@ -38,11 +38,14 @@ Print cache stats for a remote in JSON format
|
||||
}
|
||||
|
||||
fsrc := cmd.NewFsSrc(args)
|
||||
cmd.Run(true, true, command, func() error {
|
||||
cmd.Run(false, false, command, func() error {
|
||||
var fsCache *cache.Fs
|
||||
fsCache, ok := fsrc.(*cache.Fs)
|
||||
if !ok {
|
||||
fsCache, ok = fsrc.Features().UnWrap().(*cache.Fs)
|
||||
unwrap := fsrc.Features().UnWrap
|
||||
if unwrap != nil {
|
||||
fsCache, ok = unwrap().(*cache.Fs)
|
||||
}
|
||||
if !ok {
|
||||
return errors.Errorf("%s: is not a cache remote", fsrc.Name())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user