Merge pull request #124 from muicoder/bugfix-1.6.12

fix enable automatic discovery with '@'
v4
Vinllen Chen 5 years ago committed by GitHub
commit 047bf142f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/redis-shake/common/configure.go

@ -106,10 +106,10 @@ func parseAddress(tp, address, redisType string, isSource bool) error {
}
if isSource && arr[0] != conf.StandAloneRoleSlave && arr[0] != conf.StandAloneRoleMaster {
return fmt.Errorf("redis role must be master or slave")
return fmt.Errorf("source redis role must be master or slave, when enable automatic discovery with '@'")
}
if !isSource && arr[0] != "" {
return fmt.Errorf("redis type[%v] leading character must be '@'", redisType)
if !isSource && arr[0] != "master" && arr[0] != "" {
return fmt.Errorf("target redis role must be master, when enable automatic discovery with '@'")
}
clusterList := strings.Split(arr[1], AddressClusterSplitter)
@ -167,4 +167,4 @@ func setAddressList(isSource bool, address string) {
} else {
conf.Options.TargetAddressList = strings.Split(address, AddressClusterSplitter)
}
}
}

Loading…
Cancel
Save