Added snapshot interval value to raft configuration

This commit is contained in:
Kelvin Clement Mwinuka
2024-01-25 18:04:02 +08:00
parent 4e12064ce8
commit bdebdea7ad

View File

@@ -40,6 +40,7 @@ func (r *Raft) RaftInit(ctx context.Context) {
raftConfig := raft.DefaultConfig()
raftConfig.LocalID = raft.ServerID(conf.ServerID)
raftConfig.SnapshotThreshold = 5
raftConfig.SnapshotInterval = 5 * time.Second
var logStore raft.LogStore
var stableStore raft.StableStore