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
{
$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) {