mirror of https://github.com/docker/docs.git
Fix leadership doc example typo
Signed-off-by: Aaron Chen <aaron.chen@curiositychina.com>
This commit is contained in:
parent
15a91b1c73
commit
3cf44b5b24
|
|
@ -15,7 +15,7 @@ if err != nil {
|
|||
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()
|
||||
if err != nil {
|
||||
log.Fatal("Cannot run for election, store is probably down")
|
||||
|
|
@ -53,7 +53,7 @@ leaderCh, _, err := follower.FollowElection()
|
|||
if err != nil {
|
||||
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`.
|
||||
log.Printf("%s is now the leader", leader)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue