File tree 1 file changed +10
-14
lines changed
1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -33,22 +33,18 @@ export const killPsTree = async (
33
33
}
34
34
} , gracefulTimeout ) ;
35
35
36
- await Promise . all (
37
- hangingPids . map ( async ( pid ) => {
38
- // eslint-disable-next-line no-unmodified-loop-condition
39
- while ( ! hitTimeout ) {
40
- const processes = await findProcess ( 'pid' , pid ) ;
36
+ // eslint-disable-next-line no-unmodified-loop-condition
37
+ while ( ! hitTimeout && hangingPids . length > 0 ) {
38
+ for ( const hangingPid of hangingPids ) {
39
+ const processes = await findProcess ( 'pid' , hangingPid ) ;
41
40
42
- if ( processes . length === 0 ) {
43
- hangingPids = hangingPids . filter ( ( hangingPid ) => hangingPid !== pid ) ;
44
-
45
- break ;
46
- }
47
-
48
- await delay ( 100 ) ;
41
+ if ( processes . length === 0 ) {
42
+ hangingPids = hangingPids . filter ( ( pid ) => pid !== hangingPid ) ;
49
43
}
50
- } ) ,
51
- ) ;
44
+ }
45
+
46
+ await delay ( 100 ) ;
47
+ }
52
48
53
49
clearTimeout ( timeoutId ) ;
54
50
You can’t perform that action at this time.
0 commit comments