use propagator batching in the scanner
This commit is contained in:
parent
9fb44e34af
commit
cc67ad4dda
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue