count, err := cache.Prune(false)
+ counter += count
+
if err != nil {
+ if os.IsNotExist(err) {
+ continue
+ }
return counter, errors.Wrapf(err, "failed to prune cache %q", k)
}
- counter += count
-
}
return counter, nil
_, err = f.Readdirnames(1)
if err == io.EOF {
// Empty dir.
- return c.Fs.Remove(name)
+ err = c.Fs.Remove(name)
+ }
+
+ if err != nil && !os.IsNotExist(err) {
+ return err
}
return nil
if err == nil {
counter++
}
- return err
+
+ if err != nil && !os.IsNotExist(err) {
+ return err
+ }
+
}
return nil