Skip to content

Commit c42335a

Browse files
committed
unref timer
1 parent 5b79d42 commit c42335a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/websocket-tracker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,13 @@ WebSocketTracker.prototype._onSocketError = function (err) {
233233
WebSocketTracker.prototype._startReconnectTimer = function () {
234234
var self = this
235235
var ms = Math.floor(Math.random() * RECONNECT_VARIANCE) + RECONNECT_MINIMUM
236-
setTimeout(function () {
236+
237+
var reconnectTimer = setTimeout(function () {
237238
self.destroyed = false
238239
self._openSocket()
239240
}, ms)
241+
if (reconnectTimer.unref) reconnectTimer.unref()
242+
240243
debug('reconnecting socket in %s ms', ms)
241244
}
242245

0 commit comments

Comments
 (0)