File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const getFreePort = async () => {
1515 return new Promise ( resolve => {
1616 const server = createServer ( ) ;
1717 server . listen ( 0 , ( ) => {
18- const { port } = ( server . address ( ) as AddressInfo ) ;
18+ const { port } = server . address ( ) as AddressInfo ;
1919 server . close ( ( ) => resolve ( port ) ) ;
2020 } ) ;
2121 } ) ;
@@ -121,8 +121,13 @@ export class ChildPool {
121121 child . stdout . pipe ( process . stdout ) ;
122122 child . stderr . pipe ( process . stderr ) ;
123123
124- await initChild ( child , child . processFile ) ;
125- return child ;
124+ try {
125+ await initChild ( child , child . processFile ) ;
126+ return child ;
127+ } catch ( err ) {
128+ _this . release ( child ) ;
129+ throw err ;
130+ }
126131 }
127132
128133 release ( child : ChildProcessExt ) : void {
You can’t perform that action at this time.
0 commit comments