summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2014-09-25 15:53:33 +0200
committerRobin Appelman <robin@icewind.nl>2014-09-25 15:53:33 +0200
commit6365c57b04b056bc17ce6d7f23b40acce35058ef (patch)
tree20f723d4424c75ab0bb200a65f8646a35c4b5d1c /lib/private
parent9fc23e1967371d3765f24d74339704df77e29606 (diff)
parentf88021dbbc3b53e4a1460a79185835770514722e (diff)
downloadnextcloud-server-6365c57b04b056bc17ce6d7f23b40acce35058ef.tar.gz
nextcloud-server-6365c57b04b056bc17ce6d7f23b40acce35058ef.zip
Merge pull request #11282 from owncloud/scanner-memory-stable7
Don't keep the full info of all children in memory
Diffstat (limited to 'lib/private')
-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;