Skip to content

Commit 68992df

Browse files
authored
Set IsClusterMode When ClusterAddresses is used (#1234)
1 parent 7ce7550 commit 68992df

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

redis/redis.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ import (
1919
"crypto/tls"
2020
"time"
2121

22-
"github.com/livekit/protocol/xtls"
2322
"github.com/pkg/errors"
2423
"github.com/redis/go-redis/v9"
2524

25+
"github.com/livekit/protocol/xtls"
26+
2627
"github.com/livekit/protocol/logger"
2728
)
2829

@@ -129,14 +130,15 @@ func GetRedisClient(conf *RedisConfig) (redis.UniversalClient, error) {
129130
} else if len(conf.ClusterAddresses) > 0 {
130131
logger.Infow("connecting to redis", "cluster", true, "addr", conf.ClusterAddresses)
131132
rcOptions = &redis.UniversalOptions{
132-
Addrs: conf.ClusterAddresses,
133-
Username: conf.Username,
134-
Password: conf.Password,
135-
DB: conf.DB,
136-
TLSConfig: tlsConfig,
137-
MaxRedirects: conf.GetMaxRedirects(),
138-
PoolTimeout: conf.PoolTimeout,
139-
PoolSize: conf.PoolSize,
133+
Addrs: conf.ClusterAddresses,
134+
Username: conf.Username,
135+
Password: conf.Password,
136+
DB: conf.DB,
137+
TLSConfig: tlsConfig,
138+
MaxRedirects: conf.GetMaxRedirects(),
139+
PoolTimeout: conf.PoolTimeout,
140+
PoolSize: conf.PoolSize,
141+
IsClusterMode: true,
140142
}
141143
} else {
142144
logger.Infow("connecting to redis", "simple", true, "addr", conf.Address)

0 commit comments

Comments
 (0)