File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ WebSocketTracker.prototype.destroy = function (cb) {
8787 if ( self . destroyed ) return cb ( null )
8888 self . destroyed = true
8989 clearInterval ( self . interval )
90+ clearTimeout ( self . reconnectTimer )
9091
9192 if ( socketPool [ self . announceUrl ] ) socketPool [ self . announceUrl ] . consumers --
9293
@@ -299,11 +300,11 @@ WebSocketTracker.prototype._startReconnectTimer = function () {
299300 var ms = Math . floor ( Math . random ( ) * RECONNECT_VARIANCE ) + Math . min ( Math . pow ( 2 , self . retries ) * RECONNECT_MINIMUM , RECONNECT_MAXIMUM )
300301
301302 self . reconnecting = true
302- var reconnectTimer = setTimeout ( function ( ) {
303+ self . reconnectTimer = setTimeout ( function ( ) {
303304 self . retries ++
304305 self . _openSocket ( )
305306 } , ms )
306- if ( reconnectTimer . unref ) reconnectTimer . unref ( )
307+ if ( self . reconnectTimer . unref ) self . reconnectTimer . unref ( )
307308
308309 debug ( 'reconnecting socket in %s ms' , ms )
309310}
You can’t perform that action at this time.
0 commit comments