Skip to content

Commit

Permalink
fix(cron.php): Avoid pulling configuration twice
Browse files Browse the repository at this point in the history
IConfig is a small wrapper around SystemConfig, no need to pull both of them

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Feb 8, 2024
1 parent cf6a0e0 commit 1eb8942
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

require_once __DIR__ . '/lib/versioncheck.php';

use OC\SystemConfig;
use OCP\App\IAppManager;
use OCP\BackgroundJob\IJobList;
use OCP\IAppConfig;
Expand All @@ -62,13 +61,14 @@
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);
Expand Down

0 comments on commit 1eb8942

Please sign in to comment.