diff options
author | mortee <mortee@kavemalna.hu> | 2024-02-16 12:23:43 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2024-02-21 09:16:30 +0100 |
commit | 9ee51e0c5b4e761a250fdd0413b45979dc33bb17 (patch) | |
tree | 410431d346845fd568cf0a5f8ac822b20fe383cb | |
parent | f5a5caa3cc14e5d86d3e934697fd6becbff5ba7f (diff) |
made reset logic and update problem checking independent of each other
-rw-r--r-- | lib/Command/Updater/Job.php | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/Command/Updater/Job.php b/lib/Command/Updater/Job.php index e3ecaf1e0..0a8e352a6 100644 --- a/lib/Command/Updater/Job.php +++ b/lib/Command/Updater/Job.php @@ -82,19 +82,21 @@ class Job extends Command $output->writeln("Attempting to reset the job."); $this->updaterService->reset(); $output->writeln("Done, job should execute on next schedule."); - } else { - $updateInterval = $this->config->getAppValue( - Application::NAME, - 'updateInterval', - Application::DEFAULT_SETTINGS['updateInterval'] - ); - $threshold = ($updateInterval * 2) + 900; - $elapsedSeconds = $now->getTimestamp() - $date->getTimestamp(); - if ($elapsedSeconds > $threshold) { - $output->writeln("Something is wrong with the news cronjob, execution delay exceeded the configured interval."); - return 2; - } + return 0; + } + + $updateInterval = $this->config->getAppValue( + Application::NAME, + 'updateInterval', + Application::DEFAULT_SETTINGS['updateInterval'] + ); + $threshold = ($updateInterval * 2) + 900; + $elapsedSeconds = $now->getTimestamp() - $date->getTimestamp(); + if ($elapsedSeconds > $threshold) { + $output->writeln("Something is wrong with the news cronjob, execution delay exceeded the configured interval."); + return 2; } + return 0; } } |