feat: unique redis addrs and trim spaces (#3004)

This commit is contained in:
Kevin Wan
2023-03-10 16:09:07 +08:00
committed by GitHub
parent 3c9fe0b381
commit 7a0c04bc21
3 changed files with 62 additions and 3 deletions

View File

@@ -2,7 +2,6 @@ package redis
import (
"fmt"
"strings"
red "github.com/go-redis/redis/v8"
"github.com/zeromicro/go-zero/core/logx"
@@ -32,7 +31,7 @@ func CreateBlockingNode(r *Redis) (ClosableNode, error) {
return &clientBridge{client}, nil
case ClusterType:
client := red.NewClusterClient(&red.ClusterOptions{
Addrs: strings.Split(r.Addr, ","),
Addrs: splitClusterAddrs(r.Addr),
Password: r.Pass,
MaxRetries: maxRetries,
PoolSize: 1,