From 40ad118492750f7158312e9680cbf8e8aac085ef Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 22 Feb 2025 12:51:22 +0100 Subject: [PATCH] fix(core): add server functionality check before dispatching container status --- app/Livewire/Project/Database/Heading.php | 6 ++++-- app/Livewire/Project/Service/Configuration.php | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Project/Database/Heading.php b/app/Livewire/Project/Database/Heading.php index fc0febd02..c3b57b9f4 100644 --- a/app/Livewire/Project/Database/Heading.php +++ b/app/Livewire/Project/Database/Heading.php @@ -43,8 +43,10 @@ class Heading extends Component public function check_status($showNotification = false) { - GetContainersStatus::run($this->database->destination->server); - $this->database->refresh(); + if ($this->database->destination->server->isFunctional()) { + GetContainersStatus::dispatch($this->database->destination->server); + } + if ($showNotification) { $this->dispatch('success', 'Database status updated.'); } diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php index b36a860ce..da49dcae9 100644 --- a/app/Livewire/Project/Service/Configuration.php +++ b/app/Livewire/Project/Service/Configuration.php @@ -92,7 +92,9 @@ class Configuration extends Component public function check_status() { try { - GetContainersStatus::run($this->service->server); + if ($this->service->server->isFunctional()) { + GetContainersStatus::dispatch($this->service->server); + } $this->service->applications->each(function ($application) { $application->refresh(); });