Refactor Paxos status call to remove type assertion

This commit is contained in:
Bryan Boreham committed 2016-04-07 12:12:08 +01:00
1 parent 768e2a31fa
commit 0c59de40e7
4 files changed
+14 -6

No files matched your search

+1 -1
View File
@@ -767,7 +767,7 @@ func (alloc *Allocator) update(sender mesh.PeerName, msg []byte) error {
// (if we did so on periodic gossip we would force consensus unnecessarily)
// * If we are an elector (to avoid a broadcast storm of ring request messages)
default:
if _, ok := alloc.paxos.(*paxos.Node); ok && sender != mesh.UnknownPeerName {
if alloc.paxos.IsElector() && sender != mesh.UnknownPeerName {
alloc.establishRing()
}
}