don't uninstall ping interval

This commit is contained in:
cubedro 2015-06-12 22:46:47 +03:00
parent 86282dcbc2
commit 2776a71357

View File

@ -176,7 +176,7 @@ Node.prototype.checkWeb3Connection = function()
Node.prototype.reconnectWeb3 = function() Node.prototype.reconnectWeb3 = function()
{ {
console.info("Web3 reconnect attempts started"); console.warn("Uninstalling filters and update interval");
this._web3 = false; this._web3 = false;
this._connection_attempts = 0; this._connection_attempts = 0;
@ -184,9 +184,6 @@ Node.prototype.reconnectWeb3 = function()
if(this.updateInterval) if(this.updateInterval)
clearInterval(this.updateInterval); clearInterval(this.updateInterval);
if(this.pingInterval)
clearInterval(this.pingInterval);
try try
{ {
web3.reset(); web3.reset();
@ -196,6 +193,8 @@ Node.prototype.reconnectWeb3 = function()
console.error("Web3 reset error:", err); console.error("Web3 reset error:", err);
} }
console.info("Web3 reconnect attempts started");
this.checkWeb3Connection(); this.checkWeb3Connection();
} }
@ -781,9 +780,12 @@ Node.prototype.setWatches = function()
self.getStats(); self.getStats();
}, UPDATE_INTERVAL); }, UPDATE_INTERVAL);
if( !this.pingInterval )
{
this.pingInterval = setInterval( function(){ this.pingInterval = setInterval( function(){
self.ping(); self.ping();
}, PING_INTERVAL); }, PING_INTERVAL);
}
} }
Node.prototype.init = function() Node.prototype.init = function()