Merge pull request #66 from MrPetovan/task/34-no-desc-health-cap
Cap health score if server doesn't have a description
This commit is contained in:
commit
72d5e68c96
|
@ -199,7 +199,8 @@ class Server
|
||||||
$probe_result['time'],
|
$probe_result['time'],
|
||||||
$version,
|
$version,
|
||||||
$probe_result['ssl_state'],
|
$probe_result['ssl_state'],
|
||||||
$avg_ping
|
$avg_ping,
|
||||||
|
$probe_result['data']['info'] ?? null
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->atlas->perform(
|
$this->atlas->perform(
|
||||||
|
@ -324,7 +325,8 @@ class Server
|
||||||
?int $time,
|
?int $time,
|
||||||
?string $version,
|
?string $version,
|
||||||
?int $ssl_state,
|
?int $ssl_state,
|
||||||
?float $avg_ping
|
?float $avg_ping,
|
||||||
|
?string $description
|
||||||
): int
|
): int
|
||||||
{
|
{
|
||||||
//Probe failed, costs you 30 points.
|
//Probe failed, costs you 30 points.
|
||||||
|
@ -396,6 +398,11 @@ class Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No description available penalty
|
||||||
|
if (!$description) {
|
||||||
|
$max_health = min(75, $max_health);
|
||||||
|
}
|
||||||
|
|
||||||
// No ping penalty
|
// No ping penalty
|
||||||
if (!$avg_ping) {
|
if (!$avg_ping) {
|
||||||
$max_health -= 5;
|
$max_health -= 5;
|
||||||
|
|
Loading…
Reference in a new issue