added force send after 5 updates

This commit is contained in:
cubedro 2015-02-18 04:59:03 +02:00
parent c3b41ccbda
commit fb5a1de8a2

View File

@ -60,6 +60,7 @@ function Node()
this._tries = 0;
this._down = 0;
this._lastSent = 0;
this.blocks = [];
@ -286,6 +287,15 @@ Node.prototype.changed = function()
{
var changed = ! _.isEqual(this._lastStats, JSON.stringify(this.stats));
console.log(changed);
if(this._tries - this._lastSent > 5)
{
console.log('force send');
this._lastSent = this._tries;
return true;
}
return changed;
}