diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php index 250156831..20acb4bc4 100644 --- a/app/Jobs/ContainerStatusJob.php +++ b/app/Jobs/ContainerStatusJob.php @@ -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; diff --git a/app/Jobs/ServerStatusJob.php b/app/Jobs/ServerStatusJob.php index 7d591bc83..4337cecf5 100644 --- a/app/Jobs/ServerStatusJob.php +++ b/app/Jobs/ServerStatusJob.php @@ -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()); diff --git a/app/Models/Server.php b/app/Models/Server.php index 8e7831f83..1461f8cdc 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -131,7 +131,7 @@ public function skipServer() public function checkServerRediness() { if ($this->skipServer()) { - return; + return false; } $serverUptimeCheckNumber = $this->unreachable_count; $serverUptimeCheckNumberMax = 5;