From 7ff5a6ccf4a66d0af2ff74a9626251585966f223 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 8 Oct 2015 15:29:04 +0200 Subject: Dont use a transaction in the scanner while using db based locking --- lib/private/files/utils/scanner.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/private') diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php index 35e36e23cb2..460c8007bf4 100644 --- a/lib/private/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php @@ -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,9 +157,14 @@ class Scanner extends PublicEmitter { $scanner = $storage->getScanner(); $scanner->setUseTransactions(false); $this->attachListener($mount); - $this->db->beginTransaction(); + $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); - $this->db->commit(); + if (!$isDbLocking) { + $this->db->commit(); + } } $this->propagator->propagateChanges(time()); } -- cgit v1.2.3