382f52335c
I came in like a wrecking ball.... I think the grpc server and rpc configuration for the server should be handled outside of this package. There are many ways to configure it and we need more flexability on start and shutdown for grpc services. Signal handling should be in the caller.
18 lines
326 B
Go
18 lines
326 B
Go
package element
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// Start handles cluster events
|
|
func (a *Agent) Start(s chan os.Signal) {
|
|
go func() {
|
|
for range a.peerUpdateChan {
|
|
if err := a.members.UpdateNode(nodeUpdateTimeout); err != nil {
|
|
logrus.Errorf("error updating node metadata: %s", err)
|
|
}
|
|
}
|
|
}()
|
|
}
|