diff --git a/server/rediscli/cient.go b/server/rediscli/cient.go index d7416d1c..566f01ea 100644 --- a/server/rediscli/cient.go +++ b/server/rediscli/cient.go @@ -136,8 +136,10 @@ func NewRedisReplicaClient() redis.UniversalClient { return newRedisFailoverClient(redisCfg, true) } - if redisCfg.Master.Address != redisCfg.Replica.Address { - return newRedisClient(redisCfg, redisCfg.Replica.Address) + if redisCfg.Replica.Address != "" { + if redisCfg.Master.Address != redisCfg.Replica.Address { + return newRedisClient(redisCfg, redisCfg.Replica.Address) + } } return nil