LocalID from raw string

This commit is contained in:
Konstantin Lebedev 2022-04-05 13:50:39 +05:00
parent 89d32a0670
commit 1ae7f509f5

View file

@ -73,7 +73,7 @@ func NewHashicorpRaftServer(option *RaftServerOption) (*RaftServer, error) {
}
c := raft.DefaultConfig()
c.LocalID = raft.ServerID(s.serverAddr.String()) // TODO maybee the IP:port address will change
c.LocalID = raft.ServerID(s.serverAddr) // TODO maybee the IP:port address will change
c.NoSnapshotRestoreOnStart = option.RaftResumeState
c.HeartbeatTimeout = time.Duration(float64(option.HeartbeatInterval) * (rand.Float64()*0.25 + 1))
c.ElectionTimeout = option.ElectionTimeout