commit
730cdd4d40
|
@ -189,11 +189,9 @@ func (s *Server) LastCommandName() string {
|
||||||
|
|
||||||
// Retrieves the number of member servers in the consensus.
|
// Retrieves the number of member servers in the consensus.
|
||||||
func (s *Server) MemberCount() int {
|
func (s *Server) MemberCount() int {
|
||||||
count := 1
|
s.mutex.Lock()
|
||||||
for _, _ = range s.peers {
|
defer s.mutex.Unlock()
|
||||||
count++
|
return len(s.peers) + 1
|
||||||
}
|
|
||||||
return count
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieves the number of servers required to make a quorum.
|
// Retrieves the number of servers required to make a quorum.
|
||||||
|
|
Loading…
Reference in New Issue