mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-30 19:06:21 +08:00
Added configuration options for snapshot threshold and snapshot interval
This commit is contained in:
@@ -39,8 +39,8 @@ func (r *Raft) RaftInit(ctx context.Context) {
|
||||
|
||||
raftConfig := raft.DefaultConfig()
|
||||
raftConfig.LocalID = raft.ServerID(conf.ServerID)
|
||||
raftConfig.SnapshotThreshold = 5
|
||||
raftConfig.SnapshotInterval = 5 * time.Second
|
||||
raftConfig.SnapshotThreshold = conf.SnapShotThreshold
|
||||
raftConfig.SnapshotInterval = time.Duration(conf.SnapshotInterval) * time.Second
|
||||
|
||||
var logStore raft.LogStore
|
||||
var stableStore raft.StableStore
|
||||
|
||||
Reference in New Issue
Block a user