aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/utils
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-09-08 01:34:03 +0200
committerRobin Appelman <icewind@owncloud.com>2014-09-08 14:15:41 +0200
commit644755df663e8dc295e92700da208a28c13cbaab (patch)
treeed9299c6e9d5091248c57907827721b15b70a82e /lib/private/files/utils
parent637cff68ac2944d6029eb015640bbbd0e686641b (diff)
downloadnextcloud-server-644755df663e8dc295e92700da208a28c13cbaab.tar.gz
nextcloud-server-644755df663e8dc295e92700da208a28c13cbaab.zip
Use bigger transactions when doing explicit file system scans
Diffstat (limited to 'lib/private/files/utils')
-rw-r--r--lib/private/files/utils/scanner.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php
index c2fabf51946..c7da4505af5 100644
--- a/lib/private/files/utils/scanner.php
+++ b/lib/private/files/utils/scanner.php
@@ -35,11 +35,18 @@ class Scanner extends PublicEmitter {
protected $propagator;
/**
+ * @var \OCP\IDBConnection
+ */
+ protected $db;
+
+ /**
* @param string $user
+ * @param \OCP\IDBConnection $db
*/
- public function __construct($user) {
+ public function __construct($user, $db) {
$this->user = $user;
$this->propagator = new ChangePropagator(new View(''));
+ $this->db = $db;
}
/**
@@ -121,8 +128,11 @@ class Scanner extends PublicEmitter {
throw new ForbiddenException();
}
$scanner = $storage->getScanner();
+ $scanner->useTransactions(false);
$this->attachListener($mount);
+ $this->db->beginTransaction();
$scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE);
+ $this->db->commit();
}
$this->propagator->propagateChanges(time());
}