Refactor Paxos status call to remove type assertion
This commit is contained in:
1 parent
768e2a31fa
commit
0c59de40e7
4 files changed
+14
-6
No files matched your search
+4
-2
@@ -37,8 +37,10 @@ func NewStatus(allocator *Allocator, defaultSubnet address.CIDR) *Status {
|
||||
|
||||
var paxosStatus *paxos.Status
|
||||
if allocator.awaitingConsensus && allocator.paxos != nil {
|
||||
if node, ok := allocator.paxos.(*paxos.Node); ok {
|
||||
paxosStatus = paxos.NewStatus(node)
|
||||
if allocator.paxos.IsElector() {
|
||||
if node, ok := allocator.paxos.(*paxos.Node); ok {
|
||||
paxosStatus = paxos.NewStatus(node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user