diff options
author | Vincent Petry <pvince81@owncloud.com> | 2017-04-03 11:49:30 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-26 13:26:47 +0200 |
commit | 0721a7d5cc68689a04ff0d60ed6e6e33595e267a (patch) | |
tree | a84f5b4e1f1b5f66f4f4d90651339ed42d5bd7e1 /lib/private/Files | |
parent | e3218ddffda93e1eecd4a307c70f1a8929823f9a (diff) | |
download | nextcloud-server-0721a7d5cc68689a04ff0d60ed6e6e33595e267a.tar.gz nextcloud-server-0721a7d5cc68689a04ff0d60ed6e6e33595e267a.zip |
Fix scanner after review
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index a0981beeaba..fac95462ce5 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -87,6 +87,7 @@ class Scanner extends PublicEmitter { $this->logger = $logger; $this->user = $user; $this->db = $db; + // when DB locking is used, no DB transactions will be used $this->useTransaction = !(\OC::$server->getLockingProvider() instanceof DBLockingProvider); } @@ -262,10 +263,10 @@ class Scanner extends PublicEmitter { private function postProcessEntry(IStorage $storage, $internalPath) { $this->triggerPropagator($storage, $internalPath); - $this->entriesToCommit++; if ($this->useTransaction) { - $propagator = $storage->getPropagator(); + $this->entriesToCommit++; if ($this->entriesToCommit >= self::MAX_ENTRIES_TO_COMMIT) { + $propagator = $storage->getPropagator(); $this->entriesToCommit = 0; $this->db->commit(); $propagator->commitBatch(); |