diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-09-24 17:44:56 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-10-10 15:00:14 +0400 |
commit | c526ebb8329df3cd100df82ff0517f82c18b7f2f (patch) | |
tree | edae94ad7ef88c3ebbdf71d0e0251082365d8300 | |
parent | 94d5f9e6e24bc1b3479cc1347f37f6f52342b1f9 (diff) |
Don't keep the full info of all children in memory
Backport of f88021dbbc3b53e4a1460a79185835770514722e from master
-rw-r--r-- | lib/private/files/cache/scanner.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index abba659931a..b129a516794 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -215,6 +215,17 @@ class Scanner extends BasicEmitter { return $this->scanChildren($path, $recursive, $reuse); } + protected function getExistingChildren($path) { + $existingChildren = array(); + if ($this->cache->inCache($path)) { + $children = $this->cache->getFolderContents($path); + foreach ($children as $child) { + $existingChildren[] = $child['name']; + } + } + return $existingChildren; + } + /** * scan all the files and folders in a folder * @@ -230,13 +241,7 @@ class Scanner extends BasicEmitter { $this->emit('\OC\Files\Cache\Scanner', 'scanFolder', array($path, $this->storageId)); $size = 0; $childQueue = array(); - $existingChildren = array(); - if ($this->cache->inCache($path)) { - $children = $this->cache->getFolderContents($path); - foreach ($children as $child) { - $existingChildren[] = $child['name']; - } - } + $existingChildren = $this->getExistingChildren($path); $newChildren = array(); if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) { $exceptionOccurred = false; |