summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-05-13 11:17:08 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-05-13 11:17:08 -0400
commit71eed76dbef92363d5f6eeb423496c6b8dac0579 (patch)
treec4b6d60e80d0833a0fb1d037da2795ae887769c2
parent1ec92b6377ee784c6e067a8d7e7c10ebf89367e4 (diff)
downloadnextcloud-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.php4
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;
}
}
}