change func para due to the api change in go-raft

This commit is contained in:
Xiang Li 2013-07-24 17:25:23 -07:00
parent 0c2ffa84af
commit 6c6f94fedd

10
etcd.go
View File

@ -225,6 +225,9 @@ func startRaft(securityType int) {
raftServer.SetElectionTimeout(ELECTIONTIMTOUT)
raftServer.SetHeartbeatTimeout(HEARTBEATTIMEOUT)
// start to response to raft requests
go startRaftTransport(info.RaftPort, securityType)
if raftServer.IsLogEmpty() {
// start as a leader in a new cluster
@ -249,7 +252,7 @@ func startRaft(securityType int) {
// start as a follower in a existing cluster
} else {
raftServer.StartFollower()
raftServer.StartFollower(false)
for _, machine := range cluster {
if len(machine) == 0 {
@ -270,7 +273,7 @@ func startRaft(securityType int) {
} else {
// rejoin the previous cluster
raftServer.StartFollower()
raftServer.StartFollower(true)
debug("%s restart as a follower", raftServer.Name())
}
@ -279,9 +282,6 @@ func startRaft(securityType int) {
go raftServer.Snapshot()
}
// start to response to raft requests
go startRaftTransport(info.RaftPort, securityType)
}
// Create transporter using by raft server