This commit is contained in:
@@ -120,6 +120,21 @@ export function planScaling(
|
||||
)
|
||||
return result('wait', 'Waiting for fresh occupancy evidence.');
|
||||
if (occupied + empty < desired) {
|
||||
// Brief joins do not increase spare demand until their match reaches round two.
|
||||
// Keep the ordinary desired count for reporting and surplus removal so a
|
||||
// new match or missing telemetry cannot retire an existing spare.
|
||||
const established = members.filter(
|
||||
(m) => m.state === 'occupied' && m.round !== null && m.round >= 2
|
||||
).length;
|
||||
const growthTarget = Math.min(
|
||||
policy.maximum,
|
||||
Math.max(policy.minimum, established + policy.spares)
|
||||
);
|
||||
if (occupied + empty >= growthTarget)
|
||||
return result(
|
||||
'wait',
|
||||
'Waiting for occupied lobbies to reach round 2 before adding a spare.'
|
||||
);
|
||||
if (snapshot.reservedNames.length >= policy.maximum)
|
||||
return result('wait', 'Maximum lobby reservations reached.');
|
||||
if (!snapshot.keyPool.available)
|
||||
|
||||
Reference in New Issue
Block a user