File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,10 @@ function getMemoryLimit(config: ResolvedConfig) {
170170 )
171171 }
172172
173- if ( limit && limit > 1 )
173+ // If totalmem is not supported we cannot resolve percentage based values like 0.5, "50%"
174+ if ( ( typeof limit === 'number' && limit > 1 ) || ( typeof limit === 'string' && limit . at ( - 1 ) !== '%' ) )
174175 return stringToBytes ( limit )
175176
176- // just ignore "experimentalVmWorkerMemoryLimit " value because we cannot detect memory limit
177+ // just ignore "memoryLimit " value because we cannot detect memory limit
177178 return null
178179}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export function getWorkerMemoryLimit(config: ResolvedConfig) {
2323 const memoryLimit = config . poolOptions ?. vmThreads ?. memoryLimit
2424
2525 if ( memoryLimit )
26- return stringToBytes ( memoryLimit )
26+ return memoryLimit
2727
2828 return 1 / ( config . poolOptions ?. vmThreads ?. maxThreads ?? getDefaultThreadsCount ( config ) )
2929}
@@ -94,7 +94,7 @@ export function stringToBytes(
9494 return Math . floor ( input )
9595 }
9696 else {
97- throw new Error ( 'Unexpected numerical input for "experimentalVmWorkerMemoryLimit "' )
97+ throw new Error ( 'Unexpected numerical input for "memoryLimit "' )
9898 }
9999 }
100100
You can’t perform that action at this time.
0 commit comments