Skip to content

Commit

Permalink
Fix discovery typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tanji committed Feb 6, 2018
1 parent 3199421 commit e04e31d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cluster/topology.go
Expand Up @@ -256,7 +256,7 @@ func (cluster *Cluster) TopologyDiscover() error {
// If master is not initialized, find it in the failed hosts list
if cluster.master == nil {

cluster.FailedMasterDicovery()
cluster.FailedMasterDiscovery()
}
}
}
Expand Down Expand Up @@ -381,7 +381,7 @@ func (cluster *Cluster) LostMajority() bool {

}

func (cluster *Cluster) FailedMasterDicovery() {
func (cluster *Cluster) FailedMasterDiscovery() {

// Slave master_host variable must point to failed master

Expand Down
6 changes: 3 additions & 3 deletions main.go
Expand Up @@ -187,17 +187,17 @@ func initConfig() {
m := viper.AllKeys()
currentClusterName = cfgGroup
if currentClusterName == "" {
var clusterDicovery = map[string]string{}
var clusterDiscovery = map[string]string{}
var discoveries []string
for _, k := range m {

if strings.Contains(k, ".") {
mycluster := strings.Split(k, ".")[0]
if mycluster != "default" {

_, ok := clusterDicovery[mycluster]
_, ok := clusterDiscovery[mycluster]
if !ok {
clusterDicovery[mycluster] = mycluster
clusterDiscovery[mycluster] = mycluster
discoveries = append(discoveries, mycluster)
// log.Println(strings.Split(k, ".")[0])
}
Expand Down

0 comments on commit e04e31d

Please sign in to comment.