[Pkg-owncloud-commits] [owncloud] 145/258: Don't keep the full info of all children in memory
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:30 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit bdc26c6749a07edf80e1243c0d846c53c1fbb10f
Author: Robin Appelman <icewind at owncloud.com>
Date: Wed Sep 24 15:44:56 2014 +0200
Don't keep the full info of all children in memory
---
lib/private/files/cache/scanner.php | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 89fa6b8..93df62e 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -209,6 +209,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
*
@@ -224,13 +235,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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list