diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-12-11 08:40:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-11 08:40:49 +0100 |
commit | ed54713e6abf1b2428f37ca322100bab6a6301be (patch) | |
tree | 0dec9f675ab23390ac7c61aed5d2cff65b081fcf /lib | |
parent | f4762653abcd379048b9eb0b3f692033ef66155b (diff) | |
parent | e7b882dd22474c4c1b22912e629694cb9a80b69b (diff) | |
download | nextcloud-server-ed54713e6abf1b2428f37ca322100bab6a6301be.tar.gz nextcloud-server-ed54713e6abf1b2428f37ca322100bab6a6301be.zip |
Merge pull request #49695 from nextcloud/copy-update-cache-excluded
Diffstat (limited to 'lib')
-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 aa025a3a96c..1280a2ae267 100644 --- a/lib/private/Files/Cache/Updater.php +++ b/lib/private/Files/Cache/Updater.php @@ -185,7 +185,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); + } }); } |