aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephan Orbaugh <62374139+sorbaugh@users.noreply.github.com>2024-09-17 16:35:19 +0200
committerGitHub <noreply@github.com>2024-09-17 16:35:19 +0200
commitf25acfb7990bf6d9233e1c3fb8713ea80d388084 (patch)
tree2acbc9eaf6c6f3e3fccaefc5d1c0d774619ff00a /lib
parent4d275232f084559935226a093f1c770e59c642c1 (diff)
parent9597072ada7c0b9b7ee0d6e790a8422eab73572a (diff)
downloadnextcloud-server-f25acfb7990bf6d9233e1c3fb8713ea80d388084.tar.gz
nextcloud-server-f25acfb7990bf6d9233e1c3fb8713ea80d388084.zip
Merge pull request #47986 from cfiehe/fix_move_on_same_bucket
perf(ObjectStoreStorage): Improve (slow) move on same object bucket
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index a01515ac894..1b55b4b3b44 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -593,6 +593,11 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, ?ICacheEntry $sourceCacheEntry = null): bool {
$sourceCache = $sourceStorage->getCache();
+ if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class) && $sourceStorage->getObjectStore()->getStorageId() === $this->getObjectStore()->getStorageId()) {
+ $this->getCache()->moveFromCache($sourceCache, $sourceInternalPath, $targetInternalPath);
+ // Do not import any data when source and target bucket are identical.
+ return true;
+ }
if (!$sourceCacheEntry) {
$sourceCacheEntry = $sourceCache->get($sourceInternalPath);
}