Fix leadership doc example typo

Signed-off-by: Aaron Chen <aaron.chen@curiositychina.com>
This commit is contained in:
Aaron Chen 2015-12-29 19:08:07 +08:00
parent 15a91b1c73
commit 3cf44b5b24
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ if err != nil {
panic(err) panic(err)
} }
underwood := leadership.NewCandidate(client, "service/swarm/leader", "underwood") underwood := leadership.NewCandidate(client, "service/swarm/leader", "underwood", 15*time.Second)
electedCh, _, err := underwood.RunForElection() electedCh, _, err := underwood.RunForElection()
if err != nil { if err != nil {
log.Fatal("Cannot run for election, store is probably down") log.Fatal("Cannot run for election, store is probably down")
@ -53,7 +53,7 @@ leaderCh, _, err := follower.FollowElection()
if err != nil { if err != nil {
log.Fatal("Cannot follow the election, store is probably down") log.Fatal("Cannot follow the election, store is probably down")
} }
for leader := <-leaderCh { for leader := range leaderCh {
// Leader is a string containing the value passed to `NewCandidate`. // Leader is a string containing the value passed to `NewCandidate`.
log.Printf("%s is now the leader", leader) log.Printf("%s is now the leader", leader)
} }