diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-08 14:38:03 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-08 14:38:03 +0100 |
commit | 1eb89421cce61a9a3d1b2c4c494fe6b3db16e681 (patch) | |
tree | 5cb1b860a45cea26d76d758ea493075e98b0d621 /cron.php | |
parent | cf6a0e083302bec3a387b9c27be42f64a8bf6b10 (diff) | |
download | nextcloud-server-1eb89421cce61a9a3d1b2c4c494fe6b3db16e681.tar.gz nextcloud-server-1eb89421cce61a9a3d1b2c4c494fe6b3db16e681.zip |
fix(cron.php): Avoid pulling configuration twice
IConfig is a small wrapper around SystemConfig, no need to pull both of them
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'cron.php')
-rw-r--r-- | cron.php | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -44,7 +44,6 @@ declare(strict_types=1); require_once __DIR__ . '/lib/versioncheck.php'; -use OC\SystemConfig; use OCP\App\IAppManager; use OCP\BackgroundJob\IJobList; use OCP\IAppConfig; @@ -62,13 +61,14 @@ try { Server::get(LoggerInterface::class)->debug('Update required, skipping cron', ['app' => 'cron']); exit; } - if ((bool) Server::get(SystemConfig::class)->getValue('maintenance', false)) { + + $config = Server::get(IConfig::class); + + if ($config->getSystemValueBool('maintenance', false)) { Server::get(LoggerInterface::class)->debug('We are in maintenance mode, skipping cron', ['app' => 'cron']); exit; } - $config = Server::get(IConfig::class); - // Don't do anything if Nextcloud has not been installed if (!$config->getSystemValueBool('installed', false)) { exit(0); |