From 5b9e4b172989709676762727025d4a0f99db36f1 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Wed, 22 May 2024 03:10:33 -0400 Subject: [PATCH] Always limit by nodes, was like this before anyways --- app/Services/Deployment/AllocationSelectionService.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {