From 5f2ad56529b118acfa9d4b417627e4c3734391c6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 20 Dec 2023 12:25:14 +0100 Subject: [PATCH] Update container and server status job --- app/Jobs/ContainerStatusJob.php | 2 +- app/Jobs/ServerStatusJob.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php index f42e1e7ea..a8b2c1a9a 100644 --- a/app/Jobs/ContainerStatusJob.php +++ b/app/Jobs/ContainerStatusJob.php @@ -22,7 +22,7 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - public $tries = 5; + public $tries = 4; public function backoff(): int { return isDev() ? 1 : 3; diff --git a/app/Jobs/ServerStatusJob.php b/app/Jobs/ServerStatusJob.php index 58f30b18d..20b564fe8 100644 --- a/app/Jobs/ServerStatusJob.php +++ b/app/Jobs/ServerStatusJob.php @@ -34,9 +34,10 @@ class ServerStatusJob implements ShouldQueue, ShouldBeEncrypted { ray("checking server status for {$this->server->id}"); try { - if ($this->server->isFunctional()) { - $this->cleanup(notify: false); - } + if (!$this->server->isServerReady(4)) { + throw new \RuntimeException('Server is not reachable.'); + }; + $this->cleanup(notify: false); } catch (\Throwable $e) { send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage()); ray($e->getMessage());