diff options
author | Louis <louis@chmn.me> | 2024-10-31 15:55:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 15:55:32 +0100 |
commit | 8b42f46c3d4886a15c83f854ca9ee295c4a88674 (patch) | |
tree | 32433b5519b2c3060985619abd858f23f077d162 /lib | |
parent | 6bf15d8f8d83c9b8a9ee81ca74377f46acef15ba (diff) | |
parent | 74438f7f9652436243b7884bc375ef15d1356439 (diff) | |
download | nextcloud-server-8b42f46c3d4886a15c83f854ca9ee295c4a88674.tar.gz nextcloud-server-8b42f46c3d4886a15c83f854ca9ee295c4a88674.zip |
Merge pull request #48998 from nextcloud/backport/47986/stable29
[stable29] perf(ObjectStoreStorage): Improve (slow) move on same object bucket
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index c49139424c6..5a2aaa4dc50 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -625,6 +625,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); } |