summaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2015-07-14 15:12:27 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-16 21:41:51 +0200
commitaab226cef76cd4e391182eac58689c83b20e1b29 (patch)
tree4b6d7c4c2f4c3d73c3e6e3a291bf1eb598cded56 /lib/private/files/cache
parent6cd1126dd13ec4561144a0124bedd5394a7c8ff9 (diff)
downloadnextcloud-server-aab226cef76cd4e391182eac58689c83b20e1b29.tar.gz
nextcloud-server-aab226cef76cd4e391182eac58689c83b20e1b29.zip
don't move files in cache twice, fixes renaming for objectstores
Diffstat (limited to 'lib/private/files/cache')
-rw-r--r--lib/private/files/cache/updater.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index 1e180e7993a..2de0c8fe067 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -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)) {