mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 11:26:25 +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 () {
|
WebSocketTracker.prototype._startReconnectTimer = function () {
|
||||||
var self = this
|
var self = this
|
||||||
var ms = Math.floor(Math.random() * RECONNECT_VARIANCE) + RECONNECT_MINIMUM
|
var ms = Math.floor(Math.random() * RECONNECT_VARIANCE) + RECONNECT_MINIMUM
|
||||||
setTimeout(function () {
|
|
||||||
|
var reconnectTimer = setTimeout(function () {
|
||||||
self.destroyed = false
|
self.destroyed = false
|
||||||
self._openSocket()
|
self._openSocket()
|
||||||
}, ms)
|
}, ms)
|
||||||
|
if (reconnectTimer.unref) reconnectTimer.unref()
|
||||||
|
|
||||||
debug('reconnecting socket in %s ms', ms)
|
debug('reconnecting socket in %s ms', ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user