Compare commits

..

No commits in common. "a0b20be22c9b22e57de82d09e0a301da7d340e9e" and "713e10d22341fa25a4e031d4aa04ca28b1af33ba" have entirely different histories.

1 changed files with 2 additions and 5 deletions

View File

@ -209,13 +209,10 @@ class TinyRaft extends EventEmitter
this._nextTerm(this.leadershipTimeout > 0 ? this.leadershipTimeout : -1);
this.followers = this.votes[this.nodeId];
for (const follower of this.followers)
{
if (follower != this.nodeId)
{
// Send a heartbeat to confirm leadership
this.send(follower, { type: PING, term: this.term });
}
}
this.emit('change', { state: this.state, term: this.term, leader: this.nodeId, followers: this.votes[this.nodeId] });
}
else