aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-03-07 22:53:08 +0100
committerGitHub <noreply@github.com>2024-03-07 22:53:08 +0100
commit7dd22b0c8362adb9546f97a76533e71b96aef0f0 (patch)
treefd225ae99f0cfd14139f1720062658c0e09e0dc6 /lib
parent3bad491df906e8ef127829f96c0c9312a8b4f9e2 (diff)
parent575159b819e87898d09a49ca3fecbf65d200931d (diff)
downloadnextcloud-server-7dd22b0c8362adb9546f97a76533e71b96aef0f0.tar.gz
nextcloud-server-7dd22b0c8362adb9546f97a76533e71b96aef0f0.zip
Merge pull request #43982 from nextcloud/fixMemExaust
fix(filecache): Move from array_merge to avoid memory exhaustion on large scans
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Cache.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index a512bf76ace..2c53706189a 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -585,8 +585,13 @@ class Cache implements ICache {
return $cacheEntry->getPath();
}, $children);
- $deletedIds = array_merge($deletedIds, $childIds);
- $deletedPaths = array_merge($deletedPaths, $childPaths);
+ foreach ($childIds as $childId) {
+ $deletedIds[] = $childId;
+ }
+
+ foreach ($childPaths as $childPath) {
+ $deletedPaths[] = $childPath;
+ }
$query = $this->getQueryBuilder();
$query->delete('filecache_extended')