aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-09-24 15:44:56 +0200
committerRobin Appelman <icewind@owncloud.com>2014-09-24 15:44:56 +0200
commitf88021dbbc3b53e4a1460a79185835770514722e (patch)
tree144ff9e2bb1ebe47334b8a0f811f893621f7319c /lib
parent3da6b3b5334d5661506593d66d22e2cf358582fd (diff)
downloadnextcloud-server-f88021dbbc3b53e4a1460a79185835770514722e.tar.gz
nextcloud-server-f88021dbbc3b53e4a1460a79185835770514722e.zip
Don't keep the full info of all children in memory
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/scanner.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index dfba2d920a0..444207518b2 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -224,6 +224,17 @@ class Scanner extends BasicEmitter {
return $data;
}
+ 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
*
@@ -239,13 +250,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;