summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-10-09 12:38:54 +0200
committerRobin Appelman <robin@icewind.nl>2015-10-09 12:38:54 +0200
commita42dd117e23fe685624487587cc5da7c0cd590f5 (patch)
treeee68d4bb0e3776bd7653782842ec50de0ec1a4b6 /lib/private
parent18ad60380cdd5c5e346f6b2a8dfbef0a204e00b2 (diff)
parent7ff5a6ccf4a66d0af2ff74a9626251585966f223 (diff)
downloadnextcloud-server-a42dd117e23fe685624487587cc5da7c0cd590f5.tar.gz
nextcloud-server-a42dd117e23fe685624487587cc5da7c0cd590f5.zip
Merge pull request #19654 from owncloud/db-locking-no-scan-transaction
Dont use a transaction in the scanner while using db based locking
Diffstat (limited to 'lib/private')
-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());
}