From 1fbc86c75cdbf7ef61240d6fcc62601657236a61 Mon Sep 17 00:00:00 2001 From: Jonny Power Date: Wed, 24 Sep 2025 15:07:33 -0700 Subject: [PATCH] feat: enable parallel allocations by limiting org create --- src/core/scratchorg/pool/PoolCreateImpl.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/scratchorg/pool/PoolCreateImpl.ts b/src/core/scratchorg/pool/PoolCreateImpl.ts index 04cdec03c..c8733eaa8 100644 --- a/src/core/scratchorg/pool/PoolCreateImpl.ts +++ b/src/core/scratchorg/pool/PoolCreateImpl.ts @@ -160,8 +160,10 @@ export default class PoolCreateImpl extends PoolBaseImpl { ) { pool.current_allocation = countOfActiveScratchOrgs; pool.to_allocate = 0; - pool.to_satisfy_max = - pool.maxAllocation - pool.current_allocation > 0 ? pool.maxAllocation - pool.current_allocation : 0; + pool.to_satisfy_max = Math.min( + pool.maxAllocation - pool.current_allocation > 0 ? pool.maxAllocation - pool.current_allocation : 0, + pool.batchSize + ); if (pool.snapshotPool && pool.to_satisfy_max > 0){ pool.to_allocate = pool.to_satisfy_max;