Simplify function arguments

This commit is contained in:
Alan Bernstein 2017-06-27 09:52:40 -05:00
parent e1f44d4e31
commit d96a121347
2 changed files with 4 additions and 4 deletions

View file

@ -97,9 +97,9 @@ type gossipConfig struct {
}
// NewGossipNodeSet returns a new instance of GossipNodeSet.
func NewGossipNodeSet(name string, gossipHost string, gossipPort int, gossipSeed string, sh pilosa.StatusHandler, logOutput io.Writer) *GossipNodeSet {
func NewGossipNodeSet(name string, gossipHost string, gossipPort int, gossipSeed string, server *pilosa.Server) *GossipNodeSet {
g := &GossipNodeSet{
LogOutput: logOutput,
LogOutput: server.LogOutput,
}
//TODO: pull memberlist config from pilosa.cfg file
@ -114,7 +114,7 @@ func NewGossipNodeSet(name string, gossipHost string, gossipPort int, gossipSeed
g.config.memberlistConfig.AdvertisePort = gossipPort
g.config.memberlistConfig.Delegate = g
g.statusHandler = sh
g.statusHandler = server
return g
}

View file

@ -176,7 +176,7 @@ func (m *Command) SetupServer() error {
if err != nil {
gossipHost = m.Config.Host
}
gossipNodeSet := gossip.NewGossipNodeSet(m.Config.Host, gossipHost, gossipPort, gossipSeed, m.Server, m.Server.LogOutput)
gossipNodeSet := gossip.NewGossipNodeSet(m.Config.Host, gossipHost, gossipPort, gossipSeed, m.Server)
m.Server.Cluster.NodeSet = gossipNodeSet
m.Server.Broadcaster = gossipNodeSet
m.Server.BroadcastReceiver = gossipNodeSet