]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent backgroundScan() from looping if opendir() is failing for the same path
authorMichael Gapczynski <mtgap@owncloud.com>
Mon, 13 May 2013 15:17:08 +0000 (11:17 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 13 May 2013 15:17:08 +0000 (11:17 -0400)
lib/files/cache/scanner.php

index 661bc4863305e8bc5f197165038038633f9270bf..b99dea23cbc68c69ad74e8523eba4e6678b60d2a 100644 (file)
@@ -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;
                }
        }
 }