Commit c20e9627 authored by Thomas Gelf's avatar Thomas Gelf
Browse files

Health: do not complain about new jobs...

...that have never been triggered and are not due right now

fixes #1994
parent 25323484
......@@ -21,6 +21,9 @@ before switching to a new version.
### Import and Sync
* FIX: Upper- and Lowercase property modifiers are now multibyte/UTF8-safe (#710)
### Health Check
* FIX: do not complain about no-due newly created jobs (#1994)
### Background Daemon
* FIX: Daemon didn't report DB state to systemd (#1983)
......
......@@ -212,7 +212,7 @@ class Health
$name = $job->get('job_name');
if ($job->hasBeenDisabled()) {
$check->succeed("'$name' has been disabled");
} elseif (! $job->lastAttemptSucceeded()) {
} elseif ($job->lastAttemptFailed()) {
$message = $job->get('last_error_message');
$check->fail("Last attempt for '$name' failed: $message");
} elseif ($job->isOverdue()) {
......
......@@ -156,6 +156,11 @@ class DirectorJob extends DbObjectWithSettings implements ExportInterface
return $this->get('last_attempt_succeeded') === 'y';
}
public function lastAttemptFailed()
{
return $this->get('last_attempt_succeeded') === 'n';
}
public function hasTimeperiod()
{
return $this->get('timeperiod_id') !== null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment