diff --git a/app/Exceptions/Service/Deployment/NoViableNodeException.php b/app/Exceptions/Service/Deployment/NoViableNodeException.php deleted file mode 100644 index fc2fa47b8..000000000 --- a/app/Exceptions/Service/Deployment/NoViableNodeException.php +++ /dev/null @@ -1,9 +0,0 @@ -disk, 'Disk space must be an int, got %s'); Assert::integer($this->memory, 'Memory usage must be an int, got %s'); @@ -68,16 +59,6 @@ class FindViableNodesService ->havingRaw('(IFNULL(SUM(servers.memory), 0) + ?) <= (nodes.memory * (1 + (nodes.memory_overallocate / 100)))', [$this->memory]) ->havingRaw('(IFNULL(SUM(servers.disk), 0) + ?) <= (nodes.disk * (1 + (nodes.disk_overallocate / 100)))', [$this->disk]); - if (!is_null($page)) { - $results = $results->paginate($perPage ?? 50, ['*'], 'page', $page); - } else { - $results = $results->get()->toBase(); - } - - if ($results->isEmpty()) { - throw new NoViableNodeException(trans('exceptions.deployment.no_viable_nodes')); - } - - return $results; + return $results->get(); } } diff --git a/app/Services/Servers/ServerCreationService.php b/app/Services/Servers/ServerCreationService.php index 9d9603464..d1110ade4 100644 --- a/app/Services/Servers/ServerCreationService.php +++ b/app/Services/Servers/ServerCreationService.php @@ -42,7 +42,6 @@ class ServerCreationService * @throws \Throwable * @throws \App\Exceptions\DisplayException * @throws \Illuminate\Validation\ValidationException - * @throws \App\Exceptions\Service\Deployment\NoViableNodeException * @throws \App\Exceptions\Service\Deployment\NoViableAllocationException */ public function handle(array $data, DeploymentObject $deployment = null): Server @@ -105,7 +104,6 @@ class ServerCreationService * * @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\Service\Deployment\NoViableAllocationException - * @throws \App\Exceptions\Service\Deployment\NoViableNodeException */ private function configureDeployment(array $data, DeploymentObject $deployment): Allocation {