summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-05-26 16:04:50 +0200
committerRobin Appelman <icewind@owncloud.com>2016-06-02 15:07:50 +0200
commitcc67ad4dda201b13109f378da31e66ec5fae0546 (patch)
tree41564d32dc6c44ba0d3f0487f74f8b0bab4f4f6a
parent9fb44e34affe0d4d58ecaa137e2f33d884139f11 (diff)
downloadnextcloud-server-cc67ad4dda201b13109f378da31e66ec5fae0546.tar.gz
nextcloud-server-cc67ad4dda201b13109f378da31e66ec5fae0546.zip
use propagator batching in the scanner
-rw-r--r--lib/private/Files/Utils/Scanner.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index 9b55c312e26..be35910471a 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -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);