mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
don't move files in cache twice, fixes renaming for objectstores
This commit is contained in:
parent
6cd1126dd1
commit
aab226cef7
1 changed files with 9 additions and 7 deletions
16
lib/private/files/cache/updater.php
vendored
16
lib/private/files/cache/updater.php
vendored
|
|
@ -171,13 +171,15 @@ class Updater {
|
|||
|
||||
if ($sourceStorage && $targetStorage) {
|
||||
$targetCache = $targetStorage->getCache($sourceInternalPath);
|
||||
if ($targetCache->inCache($targetInternalPath)) {
|
||||
$targetCache->remove($targetInternalPath);
|
||||
}
|
||||
if ($sourceStorage === $targetStorage) {
|
||||
$targetCache->move($sourceInternalPath, $targetInternalPath);
|
||||
} else {
|
||||
$targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath);
|
||||
if ($sourceStorage->getCache($sourceInternalPath)->inCache($sourceInternalPath)) {
|
||||
if ($targetCache->inCache($targetInternalPath)) {
|
||||
$targetCache->remove($targetInternalPath);
|
||||
}
|
||||
if ($sourceStorage === $targetStorage) {
|
||||
$targetCache->move($sourceInternalPath, $targetInternalPath);
|
||||
} else {
|
||||
$targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (pathinfo($sourceInternalPath, PATHINFO_EXTENSION) !== pathinfo($targetInternalPath, PATHINFO_EXTENSION)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue