mirror of
https://github.com/rclone/rclone.git
synced 2025-04-19 18:31:10 +08:00
vfs: fix the cache failing to upload symlinks when --links was specified
Before this change, if --vfs-cache-mode writes or above was set and --links was in use, when a symlink was saved then the VFS failed to upload it. This meant when the VFS was restarted the link wasn't there any more. This was caused by the local backend, which we use to manage the VFS cache, picking up the global --links flag. This patch makes sure that the internal instantations of the local backend in the VFS cache don't ever use the --links flag or the --local-links flag even if specified on the command line. Fixes #8367
This commit is contained in:
parent
5fa85f66fe
commit
259dbbab55
@ -227,7 +227,10 @@ func (c *Cache) createItemDir(name string) (string, error) {
|
||||
|
||||
// getBackend gets a backend for a cache root dir
|
||||
func getBackend(ctx context.Context, parentPath string, name string, relativeDirPath string) (fs.Fs, error) {
|
||||
path := fmt.Sprintf(":local,encoding='%v':%s/%s/%s", encoder.OS, parentPath, name, relativeDirPath)
|
||||
// Make sure we turn off the global links flag as it overrides the backend specific one
|
||||
ctx, ci := fs.AddConfig(ctx)
|
||||
ci.Links = false
|
||||
path := fmt.Sprintf(":local,encoding='%v',links=false:%s/%s/%s", encoder.OS, parentPath, name, relativeDirPath)
|
||||
return fscache.Get(ctx, path)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user