1
mirror of https://github.com/rclone/rclone synced 2024-12-25 17:03:45 +01:00

onedrive,drive: make errors setting permissions into no retry errors

This commit is contained in:
Nick Craig-Wood 2024-04-15 21:17:22 +01:00
parent 9fa610088f
commit 254e514330
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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.