mirror of https://github.com/status-im/consul.git
Value is already an int, remove type cast
This commit is contained in:
parent
770fa971d4
commit
c9d0b83277
|
@ -3,15 +3,16 @@ package autopilot
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
|
"strconv"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/logging"
|
"github.com/hashicorp/consul/logging"
|
||||||
"github.com/hashicorp/go-hclog"
|
"github.com/hashicorp/go-hclog"
|
||||||
"github.com/hashicorp/go-version"
|
"github.com/hashicorp/go-version"
|
||||||
"github.com/hashicorp/raft"
|
"github.com/hashicorp/raft"
|
||||||
"github.com/hashicorp/serf/serf"
|
"github.com/hashicorp/serf/serf"
|
||||||
"net"
|
|
||||||
"strconv"
|
|
||||||
"sync"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delegate is the interface for the Autopilot mechanism
|
// Delegate is the interface for the Autopilot mechanism
|
||||||
|
@ -175,7 +176,7 @@ func (a *Autopilot) RemoveDeadServers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func canRemoveServers(peers, minQuorum, deadServers int) (bool, string) {
|
func canRemoveServers(peers, minQuorum, deadServers int) (bool, string) {
|
||||||
if peers-deadServers < int(minQuorum) {
|
if peers-deadServers < minQuorum {
|
||||||
return false, fmt.Sprintf("denied, because removing %d/%d servers would leave less then minimal allowed quorum of %d servers", deadServers, peers, minQuorum)
|
return false, fmt.Sprintf("denied, because removing %d/%d servers would leave less then minimal allowed quorum of %d servers", deadServers, peers, minQuorum)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue