summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-10-08 15:29:04 +0200
committerRobin Appelman <icewind@owncloud.com>2015-10-08 15:29:04 +0200
commit7ff5a6ccf4a66d0af2ff74a9626251585966f223 (patch)
tree544043a9a4d03b524d8d417a7ccda35dafdd0dab /lib
parentcd818e7419fb39d97683ecc5803534b0ed632596 (diff)
downloadnextcloud-server-7ff5a6ccf4a66d0af2ff74a9626251585966f223.tar.gz
nextcloud-server-7ff5a6ccf4a66d0af2ff74a9626251585966f223.zip
Dont use a transaction in the scanner while using db based locking
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/utils/scanner.php10
1 files changed, 8 insertions, 2 deletions
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());
}