From 8cb69787b20faf5b35d641507108572867c7ac3c Mon Sep 17 00:00:00 2001 From: muicoder Date: Mon, 15 Jul 2019 22:37:09 +0800 Subject: [PATCH] update fix enable automatic discovery with '@' --- src/redis-shake/common/configure.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redis-shake/common/configure.go b/src/redis-shake/common/configure.go index fe08125..5a0b597 100644 --- a/src/redis-shake/common/configure.go +++ b/src/redis-shake/common/configure.go @@ -108,7 +108,7 @@ func parseAddress(tp, address, redisType string, isSource bool) error { if isSource && arr[0] != conf.StandAloneRoleSlave && arr[0] != conf.StandAloneRoleMaster { return fmt.Errorf("source redis role must be master or slave, when enable automatic discovery with '@'") } - if !isSource && arr[0] != "master" { + if !isSource && arr[0] != "master" && arr[0] != "" { return fmt.Errorf("target redis role must be master, when enable automatic discovery with '@'") } @@ -167,4 +167,4 @@ func setAddressList(isSource bool, address string) { } else { conf.Options.TargetAddressList = strings.Split(address, AddressClusterSplitter) } -} \ No newline at end of file +}