mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 11:52:42 +08:00
onedrive,drive: make errors setting permissions into no retry errors
This commit is contained in:
parent
9fa610088f
commit
254e514330
|
@ -9,6 +9,7 @@ import (
|
|||
"sync"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/fserrors"
|
||||
"github.com/rclone/rclone/lib/errcount"
|
||||
"golang.org/x/sync/errgroup"
|
||||
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)
|
||||
}
|
||||
}
|
||||
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
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
"github.com/rclone/rclone/backend/onedrive/api"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/fserrors"
|
||||
"github.com/rclone/rclone/lib/dircache"
|
||||
"github.com/rclone/rclone/lib/errcount"
|
||||
"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)
|
||||
}
|
||||
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user