Skip to content

Commit

Permalink
Health: do not complain about new jobs...
Browse files Browse the repository at this point in the history
...that have never been triggered and are not due right now

fixes #1994
  • Loading branch information
Thomas-Gelf committed Oct 16, 2019
1 parent 2532348 commit c20e962
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/82-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion library/Director/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function checkDirectorJobs()
$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()) {
Expand Down
5 changes: 5 additions & 0 deletions library/Director/Objects/DirectorJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ public function lastAttemptSucceeded()
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;
Expand Down

0 comments on commit c20e962

Please sign in to comment.