Merge pull request #3335 from owncloud/prevent-scan-loop
Prevent backgroundScan() from looping
This commit is contained in:
commit
fb4d8ddf0a
|
@ -179,9 +179,11 @@ class Scanner {
|
||||||
* walk over any folders that are not fully scanned yet and scan them
|
* walk over any folders that are not fully scanned yet and scan them
|
||||||
*/
|
*/
|
||||||
public function backgroundScan() {
|
public function backgroundScan() {
|
||||||
while (($path = $this->cache->getIncomplete()) !== false) {
|
$lastPath = null;
|
||||||
|
while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) {
|
||||||
$this->scan($path);
|
$this->scan($path);
|
||||||
$this->cache->correctFolderSize($path);
|
$this->cache->correctFolderSize($path);
|
||||||
|
$lastPath = $path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue