diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-27 11:35:57 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-27 11:35:57 -0400 |
commit | 16925672e885071afab1fe158dc206ab8ed93baf (patch) | |
tree | 143f64c88d7d47cb0f5a3a7641228a7cae24821b /lib/files/cache/scanner.php | |
parent | 0953b68556152187ed305323b64b186cc21c2ade (diff) | |
parent | 0c621ff6a93fe1b34c77257d83fd344489f59bab (diff) | |
download | nextcloud-server-16925672e885071afab1fe158dc206ab8ed93baf.tar.gz nextcloud-server-16925672e885071afab1fe158dc206ab8ed93baf.zip |
Merge branch 'master' into googledrive
Diffstat (limited to 'lib/files/cache/scanner.php')
-rw-r--r-- | lib/files/cache/scanner.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 661bc486330..46122221dc2 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -51,6 +51,7 @@ class Scanner { $data['size'] = $this->storage->filesize($path); } $data['etag'] = $this->storage->getETag($path); + $data['storage_mtime'] = $data['mtime']; return $data; } @@ -115,7 +116,7 @@ class Scanner { \OC_DB::beginTransaction(); while ($file = readdir($dh)) { $child = ($path) ? $path . '/' . $file : $file; - if (!$this->isIgnoredDir($file)) { + if (!\OC\Files\Filesystem::isIgnoredDir($file)) { $data = $this->scanFile($child, $recursive === self::SCAN_SHALLOW); if ($data) { if ($data['size'] === -1) { @@ -150,18 +151,6 @@ class Scanner { } /** - * @brief check if the directory should be ignored when scanning - * NOTE: the special directories . and .. would cause never ending recursion - * @param String $dir - * @return boolean - */ - private function isIgnoredDir($dir) { - if ($dir === '.' || $dir === '..') { - return true; - } - return false; - } - /** * @brief check if the file should be ignored when scanning * NOTE: files with a '.part' extension are ignored as well! * prevents unfinished put requests to be scanned @@ -179,9 +168,11 @@ class Scanner { * walk over any folders that are not fully scanned yet and scan them */ public function backgroundScan() { - while (($path = $this->cache->getIncomplete()) !== false) { + $lastPath = null; + while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) { $this->scan($path); $this->cache->correctFolderSize($path); + $lastPath = $path; } } } |