diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-13 21:09:18 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-13 21:09:18 +0200 |
commit | db10a37080730d3a1957b858f8bdc1710801bcbe (patch) | |
tree | be622672fa5bee033b59594dc33060fac7f71b55 /service/statusservice.php | |
parent | 87cd4f362396d754632bad842daedac4d8741307 (diff) |
Better cron warning message, do not run feed updates when in ajax or web cron mode
Diffstat (limited to 'service/statusservice.php')
-rw-r--r-- | service/statusservice.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/service/statusservice.php b/service/statusservice.php index 2273d5a98..b36e64c1b 100644 --- a/service/statusservice.php +++ b/service/statusservice.php @@ -30,28 +30,26 @@ class StatusService { $this->appName = $AppName; } - - public function getStatus() { - $improperlyConfiguredCron = false; - - $version = $this->settings->getAppValue( - $this->appName, 'installed_version' - ); + public function isProperlyConfigured() { $cronMode = $this->settings->getAppValue( 'core', 'backgroundjobs_mode' ); - $cronOn = $this->config->getUseCronUpdates(); + $cronOff = !$this->config->getUseCronUpdates(); // check for cron modes which may lead to problems - if ($cronMode !== 'cron' && $cronOn) { - $improperlyConfiguredCron = true; - } + return $cronMode === 'cron' || $cronOff; + } + + public function getStatus() { + $version = $this->settings->getAppValue( + $this->appName, 'installed_version' + ); return [ 'version' => $version, 'warnings' => [ - 'improperlyConfiguredCron' => $improperlyConfiguredCron + 'improperlyConfiguredCron' => !$this->isProperlyConfigured() ] ]; } |