Compare commits

..

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

1 changed files with 5 additions and 2 deletions

View File

@ -210,8 +210,11 @@ class TinyRaft extends EventEmitter
this.followers = this.votes[this.nodeId];
for (const follower of this.followers)
{
// Send a heartbeat to confirm leadership
this.send(follower, { type: PING, term: this.term });
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] });
}