Refactor ServerCheckJob to remove unused properties and improve performance

This commit is contained in:
Andras Bacsai
2024-11-02 12:38:38 +01:00
parent 1c9844cc87
commit 0c77a826c3

View File

@@ -25,19 +25,6 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
public $containers; public $containers;
public $applications;
public $databases;
public $services;
public $previews;
public function backoff(): int
{
return isDev() ? 1 : 3;
}
public function __construct(public Server $server) {} public function __construct(public Server $server) {}
public function handle() public function handle()
@@ -47,11 +34,6 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
return 'Server is not reachable or not ready.'; return 'Server is not reachable or not ready.';
} }
$this->applications = $this->server->applications();
$this->databases = $this->server->databases();
$this->services = $this->server->services()->get();
$this->previews = $this->server->previews();
if (! $this->server->isSwarmWorker() && ! $this->server->isBuildServer()) { if (! $this->server->isSwarmWorker() && ! $this->server->isBuildServer()) {
['containers' => $this->containers, 'containerReplicates' => $containerReplicates] = $this->server->getContainers(); ['containers' => $this->containers, 'containerReplicates' => $containerReplicates] = $this->server->getContainers();
if (is_null($this->containers)) { if (is_null($this->containers)) {