mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 18:04:55 +01:00
union: fix tests by looking for fs.ErrorDirNotFound found in Purge and About
Before this change we errored out if one upstream errored in Purge or About. This change checks for fs.ErrorDirNotFound and skips that backend in this case.
This commit is contained in:
parent
63e4d2952b
commit
85f9bd1abf
@ -181,6 +181,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error {
|
|||||||
errs := Errors(make([]error, len(upstreams)))
|
errs := Errors(make([]error, len(upstreams)))
|
||||||
multithread(len(upstreams), func(i int) {
|
multithread(len(upstreams), func(i int) {
|
||||||
err := upstreams[i].Features().Purge(ctx, dir)
|
err := upstreams[i].Features().Purge(ctx, dir)
|
||||||
|
if errors.Cause(err) == fs.ErrorDirNotFound {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
errs[i] = errors.Wrap(err, upstreams[i].Name())
|
errs[i] = errors.Wrap(err, upstreams[i].Name())
|
||||||
})
|
})
|
||||||
return errs.Err()
|
return errs.Err()
|
||||||
@ -504,6 +507,9 @@ func (f *Fs) About(ctx context.Context) (*fs.Usage, error) {
|
|||||||
}
|
}
|
||||||
for _, u := range f.upstreams {
|
for _, u := range f.upstreams {
|
||||||
usg, err := u.About(ctx)
|
usg, err := u.About(ctx)
|
||||||
|
if errors.Cause(err) == fs.ErrorDirNotFound {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -335,6 +335,9 @@ func (f *Fs) updateUsageCore(lock bool) error {
|
|||||||
usage, err := f.RootFs.Features().About(ctx)
|
usage, err := f.RootFs.Features().About(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
f.cacheUpdate = false
|
f.cacheUpdate = false
|
||||||
|
if errors.Cause(err) == fs.ErrorDirNotFound {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if lock {
|
if lock {
|
||||||
|
Loading…
Reference in New Issue
Block a user