diff options
author | Simon L <szaimen@e.mail.de> | 2023-04-18 13:31:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 13:31:57 +0200 |
commit | 1a255379e85f02f3fb301f709720f3210f56b011 (patch) | |
tree | 21bb09aaa372ea62a74168ba5220178f934d48ad /apps/settings | |
parent | f74840f5b837207837b64ed5781d7288e483831f (diff) | |
parent | e2ab9bf4af3d9c801c4586b843cbc5419d6840fd (diff) | |
download | nextcloud-server-1a255379e85f02f3fb301f709720f3210f56b011.tar.gz nextcloud-server-1a255379e85f02f3fb301f709720f3210f56b011.zip |
Merge pull request #37766 from nextcloud/enh/noid/add-db-file-locking-check
add an admin check for db file locking
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 6 | ||||
-rw-r--r-- | apps/settings/tests/Controller/CheckSetupControllerTest.php | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 81a112cac55..cdf660bde86 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -59,6 +59,7 @@ use OC\DB\MissingPrimaryKeyInformation; use OC\DB\SchemaWrapper; use OC\IntegrityCheck\Checker; use OC\Lock\NoopLockingProvider; +use OC\Lock\DBLockingProvider; use OC\MemoryInfo; use OCA\Settings\SetupChecks\CheckUserCertificates; use OCA\Settings\SetupChecks\LdapInvalidUuids; @@ -619,6 +620,10 @@ Raw output return !($this->lockingProvider instanceof NoopLockingProvider); } + protected function hasDBFileLocking(): bool { + return ($this->lockingProvider instanceof DBLockingProvider); + } + protected function getSuggestedOverwriteCliURL(): string { $currentOverwriteCliUrl = $this->config->getSystemValue('overwrite.cli.url', ''); $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; @@ -875,6 +880,7 @@ Raw output 'wasEmailTestSuccessful' => $this->wasEmailTestSuccessful(), 'hasFileinfoInstalled' => $this->hasFileinfoInstalled(), 'hasWorkingFileLocking' => $this->hasWorkingFileLocking(), + 'hasDBFileLocking' => $this->hasDBFileLocking(), 'suggestedOverwriteCliURL' => $this->getSuggestedOverwriteCliURL(), 'cronInfo' => $this->getLastCronInfo(), 'cronErrors' => $this->getCronErrors(), diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index 81aa7af0b21..2b074d24c39 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -186,6 +186,7 @@ class CheckSetupControllerTest extends TestCase { 'hasValidTransactionIsolationLevel', 'hasFileinfoInstalled', 'hasWorkingFileLocking', + 'hasDBFileLocking', 'getLastCronInfo', 'getSuggestedOverwriteCliURL', 'getCurlVersion', @@ -504,6 +505,10 @@ class CheckSetupControllerTest extends TestCase { ->willReturn(true); $this->checkSetupController ->expects($this->once()) + ->method('hasDBFileLocking') + ->willReturn(true); + $this->checkSetupController + ->expects($this->once()) ->method('getSuggestedOverwriteCliURL') ->willReturn(''); $this->checkSetupController @@ -604,6 +609,7 @@ class CheckSetupControllerTest extends TestCase { 'hasValidTransactionIsolationLevel' => true, 'hasFileinfoInstalled' => true, 'hasWorkingFileLocking' => true, + 'hasDBFileLocking' => true, 'suggestedOverwriteCliURL' => '', 'cronInfo' => [ 'diffInSeconds' => 123, |