mirror of
https://github.com/pelican-dev/panel.git
synced 2026-07-15 19:53:59 +03:00
Skip daemon RPC calls for servers on maintenance-mode nodes (#2371)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user