From cc2aa38ad4536dc8c5db013add164a471c816b40 Mon Sep 17 00:00:00 2001 From: stdpi Date: Thu, 11 Jun 2026 18:05:47 +0700 Subject: [PATCH] Skip daemon RPC calls for servers on maintenance-mode nodes (#2371) --- app/Models/Server.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Models/Server.php b/app/Models/Server.php index 073a39be2..fbfba6f0f 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -457,6 +457,10 @@ class Server extends Model implements HasAvatar, Validatable public function retrieveStatus(): ContainerStatus { + if ($this->node->isUnderMaintenance()) { + return ContainerStatus::Missing; + } + return cache()->remember("servers.$this->uuid.status", now()->addSeconds(15), function () { // @phpstan-ignore myCustomRules.forbiddenGlobalFunctions $details = app(DaemonServerRepository::class)->setServer($this)->getDetails(); @@ -470,6 +474,10 @@ class Server extends Model implements HasAvatar, Validatable */ public function retrieveResources(): array { + if ($this->node->isUnderMaintenance()) { + return []; + } + return cache()->remember("servers.$this->uuid.resources", now()->addSeconds(15), function () { // @phpstan-ignore myCustomRules.forbiddenGlobalFunctions $details = app(DaemonServerRepository::class)->setServer($this)->getDetails();