Skip to content
Snippets Groups Projects
Commit f88021db authored by Robin Appelman's avatar Robin Appelman
Browse files

Don't keep the full info of all children in memory

parent 3da6b3b5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment