Always limit by nodes, was like this before anyways

This commit is contained in:
Lance Pioch 2024-05-22 03:10:33 -04:00
parent 48f715ae69
commit 5b9e4b1729

View File

@ -90,11 +90,10 @@ class AllocationSelectionService
*/ */
private function getRandomAllocation(array $nodes = [], array $ports = [], bool $dedicated = false): ?Allocation private function getRandomAllocation(array $nodes = [], array $ports = [], bool $dedicated = false): ?Allocation
{ {
$query = Allocation::query()->whereNull('server_id'); $query = Allocation::query()
->whereNull('server_id')
if (!empty($nodes)) { ->whereIn('node_id', $nodes)
$query->whereIn('node_id', $nodes); ;
}
if (!empty($ports)) { if (!empty($ports)) {
$query->where(function ($inner) use ($ports) { $query->where(function ($inner) use ($ports) {