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;