reids cluster bug (#2986)
Co-authored-by: shaocongcong <shao.congcong@yalla.live>
This commit is contained in:
@@ -2,6 +2,7 @@ package redis
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
red "github.com/go-redis/redis/v8"
|
red "github.com/go-redis/redis/v8"
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
@@ -31,7 +32,7 @@ func CreateBlockingNode(r *Redis) (ClosableNode, error) {
|
|||||||
return &clientBridge{client}, nil
|
return &clientBridge{client}, nil
|
||||||
case ClusterType:
|
case ClusterType:
|
||||||
client := red.NewClusterClient(&red.ClusterOptions{
|
client := red.NewClusterClient(&red.ClusterOptions{
|
||||||
Addrs: []string{r.Addr},
|
Addrs: strings.Split(r.Addr, ","),
|
||||||
Password: r.Pass,
|
Password: r.Pass,
|
||||||
MaxRetries: maxRetries,
|
MaxRetries: maxRetries,
|
||||||
PoolSize: 1,
|
PoolSize: 1,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package redis
|
|||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"io"
|
"io"
|
||||||
|
"strings"
|
||||||
|
|
||||||
red "github.com/go-redis/redis/v8"
|
red "github.com/go-redis/redis/v8"
|
||||||
"github.com/zeromicro/go-zero/core/syncx"
|
"github.com/zeromicro/go-zero/core/syncx"
|
||||||
@@ -19,7 +20,7 @@ func getCluster(r *Redis) (*red.ClusterClient, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
store := red.NewClusterClient(&red.ClusterOptions{
|
store := red.NewClusterClient(&red.ClusterOptions{
|
||||||
Addrs: []string{r.Addr},
|
Addrs: strings.Split(r.Addr, ","),
|
||||||
Password: r.Pass,
|
Password: r.Pass,
|
||||||
MaxRetries: maxRetries,
|
MaxRetries: maxRetries,
|
||||||
MinIdleConns: idleConns,
|
MinIdleConns: idleConns,
|
||||||
|
|||||||
Reference in New Issue
Block a user