Dont use a transaction in the scanner while using db based locking
This commit is contained in:
parent
cd818e7419
commit
7ff5a6ccf4
|
@ -31,6 +31,7 @@ use OC\Files\Cache\ChangePropagator;
|
|||
use OC\Files\Filesystem;
|
||||
use OC\ForbiddenException;
|
||||
use OC\Hooks\PublicEmitter;
|
||||
use OC\Lock\DBLockingProvider;
|
||||
|
||||
/**
|
||||
* Class Scanner
|
||||
|
@ -156,10 +157,15 @@ class Scanner extends PublicEmitter {
|
|||
$scanner = $storage->getScanner();
|
||||
$scanner->setUseTransactions(false);
|
||||
$this->attachListener($mount);
|
||||
$isDbLocking = \OC::$server->getLockingProvider() instanceof DBLockingProvider;
|
||||
if (!$isDbLocking) {
|
||||
$this->db->beginTransaction();
|
||||
}
|
||||
$scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE);
|
||||
if (!$isDbLocking) {
|
||||
$this->db->commit();
|
||||
}
|
||||
}
|
||||
$this->propagator->propagateChanges(time());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue