From 9ee51e0c5b4e761a250fdd0413b45979dc33bb17 Mon Sep 17 00:00:00 2001 From: mortee Date: Fri, 16 Feb 2024 12:23:43 +0100 Subject: made reset logic and update problem checking independent of each other --- lib/Command/Updater/Job.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'lib') 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; } } -- cgit v1.2.3