From c41cfe2a2fe235dcbad0b910ae5f9040dc8e4b70 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 20 Dec 2023 12:32:46 +0100 Subject: [PATCH] Fix server status check and cleanup logic --- app/Jobs/ServerStatusJob.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Jobs/ServerStatusJob.php b/app/Jobs/ServerStatusJob.php index 20b564fe8..c162d3bc3 100644 --- a/app/Jobs/ServerStatusJob.php +++ b/app/Jobs/ServerStatusJob.php @@ -33,11 +33,13 @@ public function uniqueId(): int public function handle(): void { ray("checking server status for {$this->server->id}"); + if (!$this->server->isServerReady(4)) { + throw new \RuntimeException('Server is not reachable.'); + }; try { - if (!$this->server->isServerReady(4)) { - throw new \RuntimeException('Server is not reachable.'); - }; - $this->cleanup(notify: false); + if ($this->server->isFunctional()) { + $this->cleanup(notify: false); + } } catch (\Throwable $e) { send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage()); ray($e->getMessage());