mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: only do cache copy in updater if the parent folder should be in cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
4fbeba3038
commit
a4d2af5155
1 changed files with 9 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue