File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -261,29 +261,28 @@ export async function waitForAnyProcessOutputToMatch(
261261export async function killAllProcesses ( signal : NodeJS . Signals = 'SIGTERM' ) : Promise < void > {
262262 let attempts = 0 ;
263263 const maxRetries = 3 ;
264- const processes = [ ..._processes ] ;
265264
266- while ( processes . length > 0 && attempts < maxRetries ) {
265+ while ( _processes . length > 0 && attempts < maxRetries ) {
267266 attempts ++ ;
268267
269268 // Iterate backwards so we can remove elements while looping if needed.
270- for ( let i = processes . length - 1 ; i >= 0 ; i -- ) {
271- const childProc = processes [ i ] ;
269+ for ( let i = _processes . length - 1 ; i >= 0 ; i -- ) {
270+ const childProc = _processes [ i ] ;
272271
273272 if ( ! childProc || childProc . killed ) {
274- processes . splice ( i , 1 ) ;
273+ _processes . splice ( i , 1 ) ;
275274 continue ;
276275 }
277276
278277 const killed = childProc . kill ( signal ) ;
279278 if ( killed ) {
280- processes . splice ( i , 1 ) ;
279+ _processes . splice ( i , 1 ) ;
281280 continue ;
282281 }
283282 }
284283
285284 // If still have processes, wait a bit before the next retry (e.g., 100ms)
286- if ( processes . length > 0 && attempts < maxRetries ) {
285+ if ( _processes . length > 0 && attempts < maxRetries ) {
287286 await sleep ( 100 ) ;
288287 }
289288 }
You can’t perform that action at this time.
0 commit comments