use propagator batching in the scanner

This commit is contained in:
Robin Appelman 2016-05-26 16:04:50 +02:00
parent 9fb44e34af
commit cc67ad4dda
1 changed files with 4 additions and 0 deletions

View File

@ -138,7 +138,9 @@ class Scanner extends PublicEmitter {
$this->triggerPropagator($storage, $path);
});
$storage->getPropagator()->beginBatch();
$scanner->backgroundScan();
$storage->getPropagator()->commitBatch();
}
}
@ -182,12 +184,14 @@ class Scanner extends PublicEmitter {
$this->db->beginTransaction();
}
try {
$storage->getPropagator()->beginBatch();
$scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE);
$cache = $storage->getCache();
if ($cache instanceof Cache) {
// only re-calculate for the root folder we scanned, anything below that is taken care of by the scanner
$cache->correctFolderSize($relativePath);
}
$storage->getPropagator()->commitBatch();
} catch (StorageNotAvailableException $e) {
$this->logger->error('Storage ' . $storage->getId() . ' not available');
$this->logger->logException($e);