mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 03:16:24 +00:00
unref timer
This commit is contained in:
parent
5b79d42dcd
commit
c42335af43
@ -233,10 +233,13 @@ WebSocketTracker.prototype._onSocketError = function (err) {
|
||||
WebSocketTracker.prototype._startReconnectTimer = function () {
|
||||
var self = this
|
||||
var ms = Math.floor(Math.random() * RECONNECT_VARIANCE) + RECONNECT_MINIMUM
|
||||
setTimeout(function () {
|
||||
|
||||
var reconnectTimer = setTimeout(function () {
|
||||
self.destroyed = false
|
||||
self._openSocket()
|
||||
}, ms)
|
||||
if (reconnectTimer.unref) reconnectTimer.unref()
|
||||
|
||||
debug('reconnecting socket in %s ms', ms)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user