Skip to content

Commit 69db833

Browse files
committed
fix(connection): unref the "_waitForConnect"
to not wait for this timeout to finish before the node process can exit
1 parent 16d2407 commit 69db833

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/connection.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,11 @@ Connection.prototype._waitForConnect = async function _waitForConnect() {
842842
},
843843
bufferTimeoutMS
844844
);
845+
846+
// dont cause this timeout to keep the js process alive
847+
if ('unref' in timeout) {
848+
timeout.unref();
849+
}
845850
})
846851
]);
847852

0 commit comments

Comments
 (0)