diff options
author | Robin Appelman <robin@icewind.nl> | 2024-12-06 17:45:07 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-04-14 15:24:11 +0000 |
commit | ba1321adb9e12c18189abeaabedc23a9986d7c03 (patch) | |
tree | 3b38631ad67fbafaa71224b6722413f49fa30dcc | |
parent | 4c67fe85219a727ae6c8b0262edffdd6238b8d61 (diff) | |
download | nextcloud-server-backport/49695/stable29.tar.gz nextcloud-server-backport/49695/stable29.zip |
fix: only do cache copy in updater if the parent folder should be in cachebackport/49695/stable29
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Files/Cache/Updater.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php index a07741e1fd4..069861198bb 100644 --- a/lib/private/Files/Cache/Updater.php +++ b/lib/private/Files/Cache/Updater.php @@ -205,7 +205,15 @@ class Updater implements IUpdater { */ public function copyFromStorage(IStorage $sourceStorage, string $source, string $target): void { $this->copyOrRenameFromStorage($sourceStorage, $source, $target, function (ICache $sourceCache, ICacheEntry $sourceInfo) use ($target) { - $this->cache->copyFromCache($sourceCache, $sourceInfo, $target); + $parent = dirname($target); + $parentInCache = $this->cache->inCache($parent); + if (!$parentInCache) { + $parentData = $this->scanner->scan($parent, Scanner::SCAN_SHALLOW, -1, false); + $parentInCache = $parentData !== null; + } + if ($parentInCache) { + $this->cache->copyFromCache($sourceCache, $sourceInfo, $target); + } }); } |