Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/files_sharing/lib/sharedstorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,15 @@ public function getScanner($path = '', $storage = null) {
}

public function getPropagator($storage = null) {
if (isset($this->propagator)) {
return $this->propagator;
}

if (!$storage) {
$storage = $this;
}
return new \OCA\Files_Sharing\SharedPropagator($storage, \OC::$server->getDatabaseConnection());
$this->propagator = new \OCA\Files_Sharing\SharedPropagator($storage, \OC::$server->getDatabaseConnection());
return $this->propagator;
}

public function getOwner($path) {
Expand Down
10 changes: 6 additions & 4 deletions lib/private/Files/Utils/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ public function backgroundScan($dir) {
$this->triggerPropagator($storage, $path);
});

$storage->getPropagator()->beginBatch();
$propagator = $storage->getPropagator();
$propagator->beginBatch();
$scanner->backgroundScan();
$storage->getPropagator()->commitBatch();
$propagator->commitBatch();
}
}

Expand Down Expand Up @@ -189,14 +190,15 @@ public function scan($dir = '') {
$this->db->beginTransaction();
}
try {
$storage->getPropagator()->beginBatch();
$propagator = $storage->getPropagator();
$propagator->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();
$propagator->commitBatch();
} catch (StorageNotAvailableException $e) {
$this->logger->error('Storage ' . $storage->getId() . ' not available');
$this->logger->logException($e);
Expand Down