Health: more granular details

This commit is contained in:
Thomas Gelf 2017-11-10 10:19:44 +01:00
parent eb087bc8b2
commit 21dff9d6d9

View File

@ -258,11 +258,15 @@ class Health
$ts = $latest->getDeploymentTimestamp(); $ts = $latest->getDeploymentTimestamp();
$time = DateFormatter::timeAgo($ts); $time = DateFormatter::timeAgo($ts);
if ($latest->succeeded()) { if ($latest->succeeded()) {
$check->succeed('The last Deployment was successful ' . $time); $check->succeed("The last Deployment was successful $time");
} elseif ($latest->isPending()) { } elseif ($latest->isPending()) {
$check->warn('The last Deployment is still pending'); if ($ts + 180 < time()) {
$check->warn("The last Deployment started $time and is still pending");
} else { } else {
$check->fail('The last Deployment failed'); $check->succeed("The last Deployment started $time and is still pending");
}
} else {
$check->fail("The last Deployment failed $time");
} }
return $check; return $check;