File tree 2 files changed +5
-4
lines changed
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) {
170
170
)
171
171
}
172
172
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 ) !== '%' ) )
174
175
return stringToBytes ( limit )
175
176
176
- // just ignore "experimentalVmWorkerMemoryLimit " value because we cannot detect memory limit
177
+ // just ignore "memoryLimit " value because we cannot detect memory limit
177
178
return null
178
179
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export function getWorkerMemoryLimit(config: ResolvedConfig) {
23
23
const memoryLimit = config . poolOptions ?. vmThreads ?. memoryLimit
24
24
25
25
if ( memoryLimit )
26
- return stringToBytes ( memoryLimit )
26
+ return memoryLimit
27
27
28
28
return 1 / ( config . poolOptions ?. vmThreads ?. maxThreads ?? getDefaultThreadsCount ( config ) )
29
29
}
@@ -94,7 +94,7 @@ export function stringToBytes(
94
94
return Math . floor ( input )
95
95
}
96
96
else {
97
- throw new Error ( 'Unexpected numerical input for "experimentalVmWorkerMemoryLimit "' )
97
+ throw new Error ( 'Unexpected numerical input for "memoryLimit "' )
98
98
}
99
99
}
100
100
You can’t perform that action at this time.
0 commit comments