This commit is contained in:
Andras Bacsai 2023-12-19 15:36:59 +01:00
parent 0126286731
commit ba769f5fb7
2 changed files with 3 additions and 3 deletions

View file

@ -45,7 +45,7 @@ public function __construct(public Server $server)
public function handle()
{
if (!$this->server->isServerReady($this->tries)) {
throw new \RuntimeException('Server is not ready.');
throw new \RuntimeException('Server is not reachable.');
};
try {
if ($this->server->isSwarm()) {

View file

@ -149,10 +149,10 @@ public function skipServer()
}
return false;
}
public function isServerReady($tries)
public function isServerReady(int $tries = 3)
{
$serverUptimeCheckNumber = $this->unreachable_count + 1;
$serverUptimeCheckNumberMax = $tries ?? 3;
$serverUptimeCheckNumberMax = $tries;
ray('server: ' . $this->name);
ray('serverUptimeCheckNumber: ' . $serverUptimeCheckNumber);