config->getSystemValueBool('config_is_read_only')) { $this->logger->debug('Skipping `updater.secret` reset since config_is_read_only is set', ['app' => 'updatenotification']); return; } $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) { $this->config->deleteSystemValue('updater.secret'); $this->appConfig->deleteKey('core', 'updater.secret.created'); $this->logger->warning('Cleared old `updater.secret` that was created ' . $secretCreatedDiff . ' seconds ago', ['app' => 'updatenotification']); } else { $this->logger->debug('Keeping existing `updater.secret` that was created ' . $secretCreatedDiff . ' seconds ago', ['app' => 'updatenotification']); } } }