Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(cron.php): Migrate uses of legacy classes from lib/private/legacy
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Feb 8, 2024
commit ecfa7c3ca359e732b8bef395edd6be9bd9107b2e
18 changes: 10 additions & 8 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
require_once __DIR__ . '/lib/versioncheck.php';

use OC\SystemConfig;
use OCP\App\IAppManager;
use OCP\BackgroundJob\IJobList;
use OCP\IAppConfig;
use OCP\IConfig;
Expand All @@ -66,8 +67,15 @@
exit;
}

$config = Server::get(IConfig::class);

// Don't do anything if Nextcloud has not been installed
if (!$config->getSystemValueBool('installed', false)) {
exit(0);
}

// load all apps to get all api routes properly setup
OC_App::loadApps();
Server::get(IAppManager::class)->loadApps();

Server::get(ISession::class)->close();

Expand All @@ -78,15 +86,9 @@
\OC::$server->setSession($session);

$logger = Server::get(LoggerInterface::class);
$config = Server::get(IConfig::class);
$appConfig = Server::get(IAppConfig::class);
$tempManager = Server::get(ITempManager::class);

// Don't do anything if Nextcloud has not been installed
if (!$config->getSystemValueBool('installed', false)) {
exit(0);
}

$tempManager->cleanOld();

// Exit if background jobs are disabled!
Expand Down Expand Up @@ -183,7 +185,7 @@
}

// clean up after unclean jobs
\OC_Util::tearDownFS();
Server::get(\OC\Files\SetupManager::class)->tearDown();
$tempManager->clean();

$jobList->setLastJob($job);
Expand Down