refactor(PeerServer): Use a config struct in PeerServer

This commit is contained in:
Brian Waldon
2014-01-15 23:17:04 -08:00
parent 91f768f9ae
commit 9c8a23c333
6 changed files with 84 additions and 66 deletions

View File

@ -52,7 +52,7 @@ func (c *JoinCommand) Apply(context raft.Context) (interface{}, error) {
}
// Check peer number in the cluster
if ps.registry.Count() == ps.MaxClusterSize {
if ps.registry.Count() == ps.Config.MaxClusterSize {
log.Debug("Reject join request from ", c.Name)
return []byte{0}, etcdErr.NewError(etcdErr.EcodeNoMorePeer, "", context.CommitIndex())
}