Join peers in create
This commit is contained in:
parent
a1a8f3fa5a
commit
d597ca32bd
1 changed files with 7 additions and 1 deletions
8
start.go
8
start.go
|
@ -7,7 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Start handles cluster events
|
// Start handles cluster events
|
||||||
func (a *Agent) Start(s chan os.Signal) {
|
func (a *Agent) Start(s chan os.Signal) error {
|
||||||
go func() {
|
go func() {
|
||||||
for range a.peerUpdateChan {
|
for range a.peerUpdateChan {
|
||||||
if err := a.members.UpdateNode(nodeUpdateTimeout); err != nil {
|
if err := a.members.UpdateNode(nodeUpdateTimeout); err != nil {
|
||||||
|
@ -15,4 +15,10 @@ func (a *Agent) Start(s chan os.Signal) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
if len(a.config.Peers) > 0 {
|
||||||
|
if _, err := a.members.Join(a.config.Peers); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue