added force send after 5 updates
This commit is contained in:
parent
c3b41ccbda
commit
fb5a1de8a2
10
lib/node.js
10
lib/node.js
@ -60,6 +60,7 @@ function Node()
|
|||||||
|
|
||||||
this._tries = 0;
|
this._tries = 0;
|
||||||
this._down = 0;
|
this._down = 0;
|
||||||
|
this._lastSent = 0;
|
||||||
|
|
||||||
this.blocks = [];
|
this.blocks = [];
|
||||||
|
|
||||||
@ -286,6 +287,15 @@ Node.prototype.changed = function()
|
|||||||
{
|
{
|
||||||
var changed = ! _.isEqual(this._lastStats, JSON.stringify(this.stats));
|
var changed = ! _.isEqual(this._lastStats, JSON.stringify(this.stats));
|
||||||
console.log(changed);
|
console.log(changed);
|
||||||
|
|
||||||
|
if(this._tries - this._lastSent > 5)
|
||||||
|
{
|
||||||
|
console.log('force send');
|
||||||
|
this._lastSent = this._tries;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user