aboutsummaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-02-08 14:16:44 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-02-08 14:16:44 +0100
commit65d013b9aefc2e8c5ae3d1f4c02368f79201e209 (patch)
tree971815449acf4816876bb1ec13e8b86da8b7e0b4 /cron.php
parent05de5e27eb1f04f586e2c66070e8d6a93bc01346 (diff)
downloadnextcloud-server-65d013b9aefc2e8c5ae3d1f4c02368f79201e209.tar.gz
nextcloud-server-65d013b9aefc2e8c5ae3d1f4c02368f79201e209.zip
fix(cron.php): Use new IAppConfig interface in cron.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/cron.php b/cron.php
index 428158f629d..1624dcdd6d0 100644
--- a/cron.php
+++ b/cron.php
@@ -46,6 +46,7 @@ require_once __DIR__ . '/lib/versioncheck.php';
use OC\SystemConfig;
use OCP\BackgroundJob\IJobList;
+use OCP\IAppConfig;
use OCP\IConfig;
use OCP\ISession;
use OCP\ITempManager;
@@ -78,6 +79,7 @@ try {
$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
@@ -88,7 +90,7 @@ try {
$tempManager->cleanOld();
// Exit if background jobs are disabled!
- $appMode = $config->getAppValue('core', 'backgroundjobs_mode', 'ajax');
+ $appMode = $appConfig->getValueString('core', 'backgroundjobs_mode', 'ajax');
if ($appMode === 'none') {
if (OC::$CLI) {
echo 'Background Jobs are disabled!' . PHP_EOL;
@@ -122,7 +124,7 @@ try {
// We call Nextcloud from the CLI (aka cron)
if ($appMode !== 'cron') {
- $config->setAppValue('core', 'backgroundjobs_mode', 'cron');
+ $appConfig->setValueString('core', 'backgroundjobs_mode', 'cron');
}
// Low-load hours
@@ -211,7 +213,7 @@ try {
}
// Log the successful cron execution
- $config->setAppValue('core', 'lastcron', time());
+ $appConfig->setValueInt('core', 'lastcron', time());
exit();
} catch (Exception $ex) {
Server::get(LoggerInterface::class)->error(