diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-07-27 11:36:27 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-08-28 22:56:29 +0200 |
commit | fa7189c40d014e865cb22e95ae51fca73c6fa2f9 (patch) | |
tree | 8895a9301c5d6cc4bdb47819b7fcc00d9949e085 | |
parent | ee1d996c6525a72164291c344bf6bea091abb96f (diff) | |
download | nextcloud-server-fa7189c40d014e865cb22e95ae51fca73c6fa2f9.tar.gz nextcloud-server-fa7189c40d014e865cb22e95ae51fca73c6fa2f9.zip |
Cache: don't check if the parent exists in the cache if we are already sure it does
-rw-r--r-- | lib/files/cache/scanner.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index e2f414be952..032e2c892ea 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -74,9 +74,10 @@ class Scanner extends BasicEmitter { * * @param string $file * @param int $reuseExisting + * @param bool $parentExists * @return array with metadata of the scanned file */ - public function scanFile($file, $reuseExisting = 0) { + public function scanFile($file, $reuseExisting = 0, $parentExists = false) { if (!self::isPartialFile($file) and !Filesystem::isFileBlacklisted($file) ) { @@ -84,7 +85,7 @@ class Scanner extends BasicEmitter { \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId)); $data = $this->getData($file); if ($data) { - if ($file) { + if ($file and !$parentExists) { $parent = dirname($file); if ($parent === '.' or $parent === '/') { $parent = ''; @@ -161,7 +162,7 @@ class Scanner extends BasicEmitter { $child = ($path) ? $path . '/' . $file : $file; if (!Filesystem::isIgnoredDir($file)) { $newChildren[] = $file; - $data = $this->scanFile($child, $reuse); + $data = $this->scanFile($child, $reuse, true); if ($data) { if ($data['size'] === -1) { if ($recursive === self::SCAN_RECURSIVE) { |