diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-13 11:17:08 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-13 11:17:08 -0400 |
commit | 71eed76dbef92363d5f6eeb423496c6b8dac0579 (patch) | |
tree | c4b6d60e80d0833a0fb1d037da2795ae887769c2 | |
parent | 1ec92b6377ee784c6e067a8d7e7c10ebf89367e4 (diff) | |
download | nextcloud-server-71eed76dbef92363d5f6eeb423496c6b8dac0579.tar.gz nextcloud-server-71eed76dbef92363d5f6eeb423496c6b8dac0579.zip |
Prevent backgroundScan() from looping if opendir() is failing for the same path
-rw-r--r-- | lib/files/cache/scanner.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 661bc486330..b99dea23cbc 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -179,9 +179,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; } } } |