Merge pull request #773 from aMoniker/develop

unref timer so it doesnt hang the node process
This commit is contained in:
FKSRipple
2019-10-23 18:29:20 -07:00
committed by GitHub

View File

@@ -466,6 +466,10 @@ class Connection extends EventEmitter {
this._whenReady(this._send(message)).then(() => {
const delay = timeout || this._timeout
timer = setTimeout(() => _reject(new TimeoutError()), delay)
// 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)
})
}