Skip to content

Commit

Permalink
Merge pull request #42827 from nextcloud/backport/41272/stable28
Browse files Browse the repository at this point in the history
[stable28] fix: reduce memory consumption of scans
  • Loading branch information
blizzz authored Jan 16, 2024
2 parents 14f2461 + d2da9c8 commit f0a6c44
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,12 @@ private function removeChildren(ICacheEntry $entry) {
}

/** @var ICacheEntry[] $childFolders */
$childFolders = array_filter($children, function ($child) {
return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER;
});
$childFolders = [];
foreach ($children as $child) {
if ($child->getMimeType() == FileInfo::MIMETYPE_FOLDER) {
$childFolders[] = $child;
}
}
foreach ($childFolders as $folder) {
$parentIds[] = $folder->getId();
$queue[] = $folder->getId();
Expand Down

0 comments on commit f0a6c44

Please sign in to comment.