]> source.dussan.org Git - nextcloud-server.git/commitdiff
feat: add option to disable scanner transactions 45857/head
authorRobin Appelman <robin@icewind.nl>
Thu, 13 Jun 2024 12:11:18 +0000 (14:11 +0200)
committerRobin Appelman <robin@icewind.nl>
Thu, 13 Jun 2024 12:11:18 +0000 (14:11 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Cache/Scanner.php

index e6c64632b6d7e06fd51da7e74e2e6681f72c45aa..de2a056a414d73175752aa83931acff37151427b 100644 (file)
@@ -39,6 +39,7 @@ use Doctrine\DBAL\Exception;
 use OC\Files\Storage\Wrapper\Encryption;
 use OC\Files\Storage\Wrapper\Jail;
 use OC\Hooks\BasicEmitter;
+use OC\SystemConfig;
 use OCP\Files\Cache\IScanner;
 use OCP\Files\ForbiddenException;
 use OCP\Files\NotFoundException;
@@ -95,7 +96,10 @@ class Scanner extends BasicEmitter implements IScanner {
                $this->storage = $storage;
                $this->storageId = $this->storage->getId();
                $this->cache = $storage->getCache();
-               $this->cacheActive = !\OC::$server->getConfig()->getSystemValueBool('filesystem_cache_readonly', false);
+               /** @var SystemConfig $config */
+               $config = \OC::$server->get(SystemConfig::class);
+               $this->cacheActive = !$config->getValue('filesystem_cache_readonly', false);
+               $this->useTransactions = !$config->getValue('filescanner_no_transactions', false);
                $this->lockingProvider = \OC::$server->getLockingProvider();
                $this->connection = \OC::$server->get(IDBConnection::class);
        }