File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export function useProxyForMongo(config: Config) {
1717 socks . SocksClient . createConnection = async ( options , callback ) => {
1818 const proxy = new HttpsProxySocket ( `https://${ config . proxy } ` , { auth : config . auth } ) ;
1919 const socket = await proxy . connect ( { host : options . destination . host , port : options . destination . port } ) ;
20+ socket . unref ( )
2021 sockets . push ( socket ) ;
2122 return {
2223 socket,
@@ -27,10 +28,7 @@ export function useProxyForMongo(config: Config) {
2728 console . log ( `Closing ${ sockets . length } open proxy sockets` ) ;
2829 for ( const socket of sockets ) {
2930 await new Promise ( ( resolve , reject ) => {
30- socket . on ( 'close' , ( ) => {
31- socket . unref ( ) ;
32- resolve ( true ) ;
33- } ) ;
31+ socket . on ( 'close' , ( ) => resolve ) ;
3432 socket . end ( ) ;
3533 } ) ;
3634 }
You can’t perform that action at this time.
0 commit comments