Persist right after loading dump

Vitaliy Filippov 2024-05-09 18:29:14 +03:00
parent 84533dc9ef
commit b80d24df5f
1 changed files with 5 additions and 1 deletions

View File

@ -373,7 +373,7 @@ class AntiCluster
}
else if (msg.load)
{
this._handleLoadMsg(client, msg);
this._handleLoadMsg(client, msg).catch(console.error);
}
else if (msg.replicate)
{
@ -425,6 +425,10 @@ class AntiCluster
this.raft.leader === client.raft_node_id && this.raft.term == msg.term)
{
this.antietcd.etctree.load(msg.load);
if (this.antietcd.persistence)
{
await this.antietcd.persistence.persist();
}
this.antietcd.stored_term = msg.term;
this.synced = true;
runCallbacks(this, 'wait_sync', []);