Add skipServer() method to Server model
This commit is contained in:
parent
673b944647
commit
5ae08d009e
@ -120,8 +120,19 @@ class Server extends BaseModel
|
|||||||
{
|
{
|
||||||
return $this->ip === 'host.docker.internal' || $this->id === 0;
|
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()
|
public function checkServerRediness()
|
||||||
{
|
{
|
||||||
|
if ($this->skipServer()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$serverUptimeCheckNumber = $this->unreachable_count;
|
$serverUptimeCheckNumber = $this->unreachable_count;
|
||||||
$serverUptimeCheckNumberMax = 5;
|
$serverUptimeCheckNumberMax = 5;
|
||||||
|
|
||||||
@ -297,6 +308,10 @@ class Server extends BaseModel
|
|||||||
}
|
}
|
||||||
public function validateConnection()
|
public function validateConnection()
|
||||||
{
|
{
|
||||||
|
if ($this->skipServer()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$uptime = instant_remote_process(['uptime'], $this, false);
|
$uptime = instant_remote_process(['uptime'], $this, false);
|
||||||
if (!$uptime) {
|
if (!$uptime) {
|
||||||
$this->settings()->update([
|
$this->settings()->update([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user