From 69db833459a284c485a745ba08041b148e8529ff Mon Sep 17 00:00:00 2001 From: hasezoey Date: Sat, 8 Feb 2025 13:59:21 +0100 Subject: [PATCH] fix(connection): unref the "_waitForConnect" to not wait for this timeout to finish before the node process can exit --- lib/connection.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/connection.js b/lib/connection.js index b0ceb77029b..f38647d855a 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -842,6 +842,11 @@ Connection.prototype._waitForConnect = async function _waitForConnect() { }, bufferTimeoutMS ); + + // dont cause this timeout to keep the js process alive + if ('unref' in timeout) { + timeout.unref(); + } }) ]);