File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ abstract class Firefox implements Interceptor {
180
180
if ( process . platform === "win32" ) {
181
181
// Firefox spawns a child process on Windows, and doesn't let us kill it at all.
182
182
// To fix this, we kill all firefox instances that were started with this exact same URL.
183
- await windowsKillByCliMatch ( `*\\ firefox.exe*${ initialUrl } ` ) . catch ( console . log ) ;
183
+ await windowsKillByCliMatch ( `*firefox.exe*${ initialUrl } ` ) . catch ( console . log ) ;
184
184
} else {
185
185
normalStop ( ) ;
186
186
}
@@ -325,8 +325,10 @@ abstract class Firefox implements Interceptor {
325
325
if ( this . isActive ( proxyPort ) ) {
326
326
const browser = this . activeBrowsers [ proxyPort ] ;
327
327
const closePromise = new Promise ( ( resolve ) => browser . process . once ( 'close' , resolve ) ) ;
328
- browser . stop ( ) ;
329
- await closePromise ;
328
+ await Promise . all ( [
329
+ browser . stop ( ) , // Await required, as on Windows this is actually async & slow
330
+ closePromise
331
+ ] ) ;
330
332
}
331
333
}
332
334
@@ -335,7 +337,7 @@ abstract class Firefox implements Interceptor {
335
337
Object . keys ( this . activeBrowsers ) . map ( ( proxyPort ) => this . deactivate ( proxyPort ) )
336
338
) ;
337
339
if ( profileSetupBrowser ) {
338
- profileSetupBrowser . stop ( ) ;
340
+ await profileSetupBrowser . stop ( ) ; // As above - on Windows this is async
339
341
return new Promise ( ( resolve ) => profileSetupBrowser ! . process . once ( 'close' , resolve ) ) ;
340
342
}
341
343
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export async function shutdown(code: number, cause: string) {
28
28
29
29
await Promise . race ( [
30
30
shutdownPromises ,
31
- delay ( 2000 ) // After 2 seconds, we just close anyway, we're done.
31
+ delay ( 3000 ) // After 3 seconds, we just close anyway, we're done.
32
32
] ) ;
33
33
34
34
process . exit ( code ) ;
You can’t perform that action at this time.
0 commit comments