reids cluster bug (#2986)

Co-authored-by: shaocongcong <shao.congcong@yalla.live>
master
文豆芽 2 years ago committed by GitHub
parent 37cb00d789
commit f8b2dc8c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -3,6 +3,7 @@ package redis
import (
"crypto/tls"
"io"
"strings"
red "github.com/go-redis/redis/v8"
"github.com/zeromicro/go-zero/core/syncx"
@ -19,7 +20,7 @@ func getCluster(r *Redis) (*red.ClusterClient, error) {
}
}
store := red.NewClusterClient(&red.ClusterOptions{
Addrs: []string{r.Addr},
Addrs: strings.Split(r.Addr, ","),
Password: r.Pass,
MaxRetries: maxRetries,
MinIdleConns: idleConns,

Loading…
Cancel
Save