aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Updater
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-03-13 01:21:40 -0100
committerMaxence Lange <maxence@artificial-owl.com>2024-03-13 02:22:11 -0100
commit519e4345739876d2ae7e064e347d19524905b090 (patch)
tree0b997f8d18f54efcb97e9278503ae42e119fd9b6 /lib/private/Updater
parent5723c13dc0c7f4025c4d976c1f792f9bb3513fe2 (diff)
downloadnextcloud-server-519e4345739876d2ae7e064e347d19524905b090.tar.gz
nextcloud-server-519e4345739876d2ae7e064e347d19524905b090.zip
fix(updatenotification): spread the use of new appconfig
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/private/Updater')
-rw-r--r--lib/private/Updater/VersionCheck.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Updater/VersionCheck.php b/lib/private/Updater/VersionCheck.php
index e37024ec2c2..01022067d87 100644
--- a/lib/private/Updater/VersionCheck.php
+++ b/lib/private/Updater/VersionCheck.php
@@ -27,6 +27,7 @@
namespace OC\Updater;
use OCP\Http\Client\IClientService;
+use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IUserManager;
use OCP\Support\Subscription\IRegistry;
@@ -37,6 +38,7 @@ class VersionCheck {
public function __construct(
private IClientService $clientService,
private IConfig $config,
+ private IAppConfig $appConfig,
private IUserManager $userManager,
private IRegistry $registry,
private LoggerInterface $logger,
@@ -56,13 +58,13 @@ class VersionCheck {
}
// Look up the cache - it is invalidated all 30 minutes
- if (((int)$this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) {
+ if (($this->appConfig->getValueInt('core', 'lastupdatedat') + 1800) > time()) {
return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true);
}
$updaterUrl = $this->config->getSystemValueString('updater.server.url', 'https://updates.nextcloud.com/updater_server/');
- $this->config->setAppValue('core', 'lastupdatedat', (string)time());
+ $this->appConfig->setValueInt('core', 'lastupdatedat', time());
if ($this->config->getAppValue('core', 'installedat', '') === '') {
$this->config->setAppValue('core', 'installedat', (string)microtime(true));
@@ -70,7 +72,7 @@ class VersionCheck {
$version = Util::getVersion();
$version['installed'] = $this->config->getAppValue('core', 'installedat');
- $version['updated'] = $this->config->getAppValue('core', 'lastupdatedat');
+ $version['updated'] = $this->appConfig->getValueInt('core', 'lastupdatedat');
$version['updatechannel'] = \OC_Util::getChannel();
$version['edition'] = '';
$version['build'] = \OC_Util::getBuild();