Skip to content

Commit 34c6cb7

Browse files
Merge pull request #56655 from nextcloud/fix/fix-updater-secret-log-spam
fix(updatenotification): Fix log spam from ResetToken job
2 parents 0e9aa3d + 98ee892 commit 34c6cb7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

apps/updatenotification/lib/BackgroundJob/ResetToken.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,17 @@ protected function run($argument) {
4343
return;
4444
}
4545

46-
$secretCreated = $this->appConfig->getValueInt('core', 'updater.secret.created');
46+
$secretCreated = $this->appConfig->getValueInt('core', 'updater.secret.created', 0);
47+
48+
if ($secretCreated === 0) {
49+
if ($this->config->getSystemValueString('updater.secret') !== '') {
50+
$this->logger->error('Cleared old `updater.secret` with unknown creation date', ['app' => 'updatenotification']);
51+
$this->config->deleteSystemValue('updater.secret');
52+
}
53+
$this->logger->debug('Skipping `updater.secret` reset since there is none', ['app' => 'updatenotification']);
54+
return;
55+
}
56+
4757
// Delete old tokens after 2 days and also tokens without any created date
4858
$secretCreatedDiff = $this->time->getTime() - $secretCreated;
4959
if ($secretCreatedDiff >= 172800) {

0 commit comments

Comments
 (0)