From aedcbe56b34b1629e30db323f4e1d5d0074beec8 Mon Sep 17 00:00:00 2001 From: FKSRipple <56697533+FKSRipple@users.noreply.github.com> Date: Wed, 23 Oct 2019 18:29:07 -0700 Subject: [PATCH] Added small style changes --- src/common/connection.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/connection.ts b/src/common/connection.ts index 51473f1a..881465b1 100644 --- a/src/common/connection.ts +++ b/src/common/connection.ts @@ -456,7 +456,10 @@ class Connection extends EventEmitter { this._whenReady(this._send(message)).then(() => { const delay = timeout || this._timeout timer = setTimeout(() => _reject(new TimeoutError()), delay) - if (timer.unref) timer.unref() + // Node.js won't exit if a timer is still running, so we tell Node to ignore (Node will still wait for the request to complete) + if (timer.unref) { + timer.unref() + } }).catch(_reject) }) }