fix(updatenotification): Fix log spam from ResetToken job

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-11-25 10:43:22 +01:00
parent 0b3041586b
commit 98ee89286d
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -43,7 +43,17 @@ class ResetToken extends TimedJob {
return;
}
$secretCreated = $this->appConfig->getValueInt('core', 'updater.secret.created');
$secretCreated = $this->appConfig->getValueInt('core', 'updater.secret.created', 0);
if ($secretCreated === 0) {
if ($this->config->getSystemValueString('updater.secret') !== '') {
$this->logger->error('Cleared old `updater.secret` with unknown creation date', ['app' => 'updatenotification']);
$this->config->deleteSystemValue('updater.secret');
}
$this->logger->debug('Skipping `updater.secret` reset since there is none', ['app' => 'updatenotification']);
return;
}
// Delete old tokens after 2 days and also tokens without any created date
$secretCreatedDiff = $this->time->getTime() - $secretCreated;
if ($secretCreatedDiff >= 172800) {