Fix server readiness check in ContainerStatusJob
and ServerStatusJob
This commit is contained in:
parent
5ae08d009e
commit
2c4e69ad50
3 changed files with 7 additions and 3 deletions
|
|
@ -39,7 +39,9 @@ public function handle(): void
|
|||
{
|
||||
// ray("checking server status for {$this->server->id}");
|
||||
try {
|
||||
$this->server->checkServerRediness();
|
||||
if (!$this->server->checkServerRediness()) {
|
||||
return;
|
||||
}
|
||||
$containers = instant_remote_process(["docker container ls -q"], $this->server);
|
||||
if (!$containers) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ public function handle(): void
|
|||
{
|
||||
ray("checking server status for {$this->server->id}");
|
||||
try {
|
||||
$this->server->checkServerRediness();
|
||||
if (!$this->server->checkServerRediness()) {
|
||||
return;
|
||||
}
|
||||
$this->cleanup(notify: false);
|
||||
} catch (\Throwable $e) {
|
||||
send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage());
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public function skipServer()
|
|||
public function checkServerRediness()
|
||||
{
|
||||
if ($this->skipServer()) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
$serverUptimeCheckNumber = $this->unreachable_count;
|
||||
$serverUptimeCheckNumberMax = 5;
|
||||
|
|
|
|||
Loading…
Reference in a new issue