Fix "leadership expiration"
parent
7aef34f5bf
commit
a6893ea494
|
@ -194,11 +194,14 @@ class TinyRaft extends EventEmitter
|
|||
}
|
||||
else if (msg.type == PONG && this.state == LEADER)
|
||||
{
|
||||
this._nextTerm(-1);
|
||||
if (msg.leader != this.nodeId)
|
||||
{
|
||||
this.start();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._nextTerm(this.leadershipTimeout > 0 ? this.leadershipTimeout : -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue