participant: retry join more times

This commit is contained in:
Yicheng Qin 2014-07-18 13:15:07 -07:00
parent e709f1b572
commit 1c9928d721

View File

@ -330,7 +330,7 @@ func (p *participant) join() {
PeerURL: p.raftPubAddr,
}
for i := 0; i < 5; i++ {
for {
for seed := range p.seeds {
if err := p.client.AddMachine(seed, fmt.Sprint(p.id), info); err == nil {
return
@ -340,4 +340,5 @@ func (p *participant) join() {
}
time.Sleep(100 * time.Millisecond)
}
log.Println("fail to join the cluster")
}