summaryrefslogtreecommitdiffstats
path: root/apps/settings/templates
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-02-06 20:10:30 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-02-08 10:21:54 +0100
commitbf74c4f21bf81cdb2d2e4188529c46215dc3bf6a (patch)
tree33426dd1a540202d76735d419c9ea2d958523a3c /apps/settings/templates
parent5c650f876c0c72e241bc3b77b8489c4e8227912f (diff)
downloadnextcloud-server-bf74c4f21bf81cdb2d2e4188529c46215dc3bf6a.tar.gz
nextcloud-server-bf74c4f21bf81cdb2d2e4188529c46215dc3bf6a.zip
Warn admins about delayed cron executions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/settings/templates')
-rw-r--r--apps/settings/templates/settings/admin/server.php38
1 files changed, 26 insertions, 12 deletions
diff --git a/apps/settings/templates/settings/admin/server.php b/apps/settings/templates/settings/admin/server.php
index 92bf433ca6c..513e82ece5a 100644
--- a/apps/settings/templates/settings/admin/server.php
+++ b/apps/settings/templates/settings/admin/server.php
@@ -29,26 +29,40 @@
<div class="section" id="backgroundjobs">
<h2 class="inlineblock"><?php p($l->t('Background jobs'));?></h2>
<p class="cronlog inlineblock">
- <?php if ($_['lastcron'] !== false):
+ <?php if ($_['lastcron'] !== false) {
$relative_time = relative_modified_date($_['lastcron']);
+ $maxAgeRelativeTime = relative_modified_date($_['cronMaxAge']);
$formatter = \OC::$server->getDateTimeFormatter();
$absolute_time = $formatter->formatDateTime($_['lastcron'], 'long', 'long');
- if (time() - $_['lastcron'] <= 600): ?>
- <span class="status success"></span>
- <span class="crondate" title="<?php p($absolute_time);?>">
- <?php p($l->t("Last job ran %s.", [$relative_time]));?>
- </span>
- <?php else: ?>
+ $maxAgeAbsoluteTime = $formatter->formatDateTime($_['cronMaxAge'], 'long', 'long');
+ if (time() - $_['lastcron'] > 600) { ?>
<span class="status error"></span>
<span class="crondate" title="<?php p($absolute_time);?>">
- <?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
- </span>
- <?php endif;
- else: ?>
+ <?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
+ </span>
+ <?php } else if (time() - $_['cronMaxAge'] > 12*3600) {
+ if ($_['backgroundjobs_mode'] === 'cron') { ?>
+ <span class="status warning"></span>
+ <span class="crondate" title="<?php p($maxAgeAbsoluteTime);?>">
+ <?php p($l->t("Some jobs haven’t been executed since %s. Please consider increasing the execution frequency.", [$maxAgeRelativeTime]));?>
+ </span>
+ <?php } else { ?>
+ <span class="status error"></span>
+ <span class="crondate" title="<?php p($maxAgeAbsoluteTime);?>">
+ <?php p($l->t("Some jobs didn’t execute since %s. Please consider switching to system cron.", [$maxAgeRelativeTime]));?>
+ </span>
+ <?php }
+ } else { ?>
+ <span class="status success"></span>
+ <span class="crondate" title="<?php p($absolute_time);?>">
+ <?php p($l->t("Last job ran %s.", [$relative_time]));?>
+ </span>
+ <?php }
+ } else { ?>
<span class="status error"></span>
<?php p($l->t("Background job didn’t run yet!"));
- endif; ?>
+ } ?>
</p>
<a target="_blank" rel="noreferrer noopener" class="icon-info"
title="<?php p($l->t('Open documentation'));?>"