From 58db0e995be2a2f7e77468512f050dbb59f153e3 Mon Sep 17 00:00:00 2001 From: muicoder Date: Mon, 15 Jul 2019 11:59:39 +0800 Subject: [PATCH] fix enable automatic discovery with '@' --- src/redis-shake/common/configure.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/redis-shake/common/configure.go b/src/redis-shake/common/configure.go index 453e4d3..fe08125 100644 --- a/src/redis-shake/common/configure.go +++ b/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" { + return fmt.Errorf("target redis role must be master, when enable automatic discovery with '@'") } clusterList := strings.Split(arr[1], AddressClusterSplitter)