Add skipServer() method to Server model

This commit is contained in:
Andras Bacsai 2023-11-17 12:47:15 +01:00
parent 673b944647
commit 5ae08d009e

View File

@ -120,8 +120,19 @@ public function isLocalhost()
{
return $this->ip === 'host.docker.internal' || $this->id === 0;
}
public function skipServer()
{
if ($this->ip === '1.2.3.4') {
ray('skipping 1.2.3.4');
return true;
}
return false;
}
public function checkServerRediness()
{
if ($this->skipServer()) {
return;
}
$serverUptimeCheckNumber = $this->unreachable_count;
$serverUptimeCheckNumberMax = 5;
@ -297,6 +308,10 @@ public function isDrainLogActivated()
}
public function validateConnection()
{
if ($this->skipServer()) {
return false;
}
$uptime = instant_remote_process(['uptime'], $this, false);
if (!$uptime) {
$this->settings()->update([