forked from TrueCloudLab/rclone
onedrive,drive: make errors setting permissions into no retry errors
This commit is contained in:
parent
9fa610088f
commit
254e514330
2 changed files with 12 additions and 2 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/rclone/rclone/fs"
|
"github.com/rclone/rclone/fs"
|
||||||
|
"github.com/rclone/rclone/fs/fserrors"
|
||||||
"github.com/rclone/rclone/lib/errcount"
|
"github.com/rclone/rclone/lib/errcount"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
drive "google.golang.org/api/drive/v3"
|
drive "google.golang.org/api/drive/v3"
|
||||||
|
@ -155,7 +156,11 @@ func (f *Fs) setPermissions(ctx context.Context, info *drive.File, permissions [
|
||||||
errs.Add(err)
|
errs.Add(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errs.Err("failed to set permission")
|
err = errs.Err("failed to set permission")
|
||||||
|
if err != nil {
|
||||||
|
err = fserrors.NoRetryError(err)
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean attributes from permissions which we can't write
|
// Clean attributes from permissions which we can't write
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
|
|
||||||
"github.com/rclone/rclone/backend/onedrive/api"
|
"github.com/rclone/rclone/backend/onedrive/api"
|
||||||
"github.com/rclone/rclone/fs"
|
"github.com/rclone/rclone/fs"
|
||||||
|
"github.com/rclone/rclone/fs/fserrors"
|
||||||
"github.com/rclone/rclone/lib/dircache"
|
"github.com/rclone/rclone/lib/dircache"
|
||||||
"github.com/rclone/rclone/lib/errcount"
|
"github.com/rclone/rclone/lib/errcount"
|
||||||
"golang.org/x/exp/slices" // replace with slices after go1.21 is the minimum version
|
"golang.org/x/exp/slices" // replace with slices after go1.21 is the minimum version
|
||||||
|
@ -462,7 +463,11 @@ func (m *Metadata) processPermissions(ctx context.Context, add, update, remove [
|
||||||
newPermissions = append(newPermissions, newP)
|
newPermissions = append(newPermissions, newP)
|
||||||
}
|
}
|
||||||
|
|
||||||
return newPermissions, errs.Err("failed to set permissions")
|
err = errs.Err("failed to set permissions")
|
||||||
|
if err != nil {
|
||||||
|
err = fserrors.NoRetryError(err)
|
||||||
|
}
|
||||||
|
return newPermissions, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// fillRecipients looks for recipients to add from the permission passed in.
|
// fillRecipients looks for recipients to add from the permission passed in.
|
||||||
|
|
Loading…
Reference in a new issue