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();