From b6e0295cf5f994bb7b03c50a8280fca013bc0c1f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 3 May 2024 16:37:45 +0200 Subject: [PATCH] feat: add option to disable scanner transactions Signed-off-by: Robin Appelman --- lib/private/Files/Cache/Scanner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 228f5d4056e65..f3122262d8d48 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -37,6 +37,7 @@ use Doctrine\DBAL\Exception; use OC\Files\Storage\Wrapper\Encryption; +use OC\SystemConfig; use OCP\Files\Cache\IScanner; use OCP\Files\ForbiddenException; use OCP\Files\Storage\IReliableEtagStorage; @@ -92,7 +93,10 @@ public function __construct(\OC\Files\Storage\Storage $storage) { $this->storage = $storage; $this->storageId = $this->storage->getId(); $this->cache = $storage->getCache(); - $this->cacheActive = !\OC::$server->getConfig()->getSystemValue('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(); }