aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Files/Cache/Updater.php11
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php2
2 files changed, 4 insertions, 9 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php
index ee320950af4..3f619ccba10 100644
--- a/lib/private/Files/Cache/Updater.php
+++ b/lib/private/Files/Cache/Updater.php
@@ -202,17 +202,10 @@ class Updater implements IUpdater {
if ($sourceInfo !== false) {
// Remove existing cache entry to no reuse the fileId.
if ($this->cache->inCache($target)) {
- $existingCacheInfo = $this->cache->get($target);
- // Do not remove the existing target if it has just been created.
- // It was probably created by the same operation and we want to keep the fileId.
- if (time() - $existingCacheInfo->getMTime() > 1) {
- $this->cache->remove($target);
- }
+ $this->cache->remove($target);
}
- if (!$this->cache->inCache($target)) {
- $operation($sourceCache, $sourceInfo);
- }
+ $operation($sourceCache, $sourceInfo);
$sourceExtension = pathinfo($source, PATHINFO_EXTENSION);
$targetExtension = pathinfo($target, PATHINFO_EXTENSION);
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index b07b6955b1a..c02d9b3a6b6 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -14,6 +14,7 @@ use Icewind\Streams\CountWrapper;
use Icewind\Streams\IteratorDirectory;
use OC\Files\Cache\Cache;
use OC\Files\Cache\CacheEntry;
+use OC\Files\Filesystem;
use OC\Files\Storage\PolyFill\CopyDirectory;
use OCP\Files\Cache\ICache;
use OCP\Files\Cache\ICacheEntry;
@@ -696,6 +697,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
throw new \Exception('Invalid source cache for object store copy');
}
+ Filesystem::getView()->disableCacheUpdate();
$targetId = $cache->copyFromCache($cache, $sourceEntry, $to);
$targetUrn = $this->getURN($targetId);