diff --git a/app/Services/Deployment/AllocationSelectionService.php b/app/Services/Deployment/AllocationSelectionService.php index 54853c025..715533cf5 100644 --- a/app/Services/Deployment/AllocationSelectionService.php +++ b/app/Services/Deployment/AllocationSelectionService.php @@ -90,11 +90,10 @@ class AllocationSelectionService */ private function getRandomAllocation(array $nodes = [], array $ports = [], bool $dedicated = false): ?Allocation { - $query = Allocation::query()->whereNull('server_id'); - - if (!empty($nodes)) { - $query->whereIn('node_id', $nodes); - } + $query = Allocation::query() + ->whereNull('server_id') + ->whereIn('node_id', $nodes) + ; if (!empty($ports)) { $query->where(function ($inner) use ($ports) {