Make sure ResetTokenBackgroundJob doesn't execute if config is read-only

No need to try to delete the config key in config.php if we aren't
allowed to.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-05-25 08:51:16 +02:00 committed by backportbot-nextcloud[bot]
parent 52fc620ba1
commit ff16e0425d

View file

@ -59,7 +59,7 @@ class ResetTokenBackgroundJob extends TimedJob {
*/
protected function run($argument) {
// Delete old tokens after 2 days
if ($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) {
if ($this->config->getSystemValueBool('config_is_read_only') === false && $this->timeFactory->getTime() - (int) $this->config->getAppValue('core', 'updater.secret.created', (string) $this->timeFactory->getTime()) >= 172800) {
$this->config->deleteSystemValue('updater.secret');
}
}