File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ type Options struct {
154154 // Add suffix to client name. Default is empty.
155155 IdentitySuffix string
156156
157- // Enable Unstable mode for Redis Search module with RESP3.
157+ // UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
158158 UnstableResp3 bool
159159}
160160
Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ type ClusterOptions struct {
9494 DisableIndentity bool // Disable set-lib on connect. Default is false.
9595
9696 IdentitySuffix string // Add suffix to client name. Default is empty.
97+
98+ // UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
99+ UnstableResp3 bool
97100}
98101
99102func (opt * ClusterOptions ) init () {
@@ -308,7 +311,8 @@ func (opt *ClusterOptions) clientOptions() *Options {
308311 // much use for ClusterSlots config). This means we cannot execute the
309312 // READONLY command against that node -- setting readOnly to false in such
310313 // situations in the options below will prevent that from happening.
311- readOnly : opt .ReadOnly && opt .ClusterSlots == nil ,
314+ readOnly : opt .ReadOnly && opt .ClusterSlots == nil ,
315+ UnstableResp3 : opt .UnstableResp3 ,
312316 }
313317}
314318
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
115115
116116 DisableIndentity : o .DisableIndentity ,
117117 IdentitySuffix : o .IdentitySuffix ,
118+ UnstableResp3 : o .UnstableResp3 ,
118119 }
119120}
120121
Original file line number Diff line number Diff line change @@ -38,4 +38,26 @@ var _ = Describe("UniversalClient", func() {
3838 })
3939 Expect (client .Ping (ctx ).Err ()).NotTo (HaveOccurred ())
4040 })
41+
42+ It ("connect to clusters with UniversalClient and UnstableResp3" , Label ("NonRedisEnterprise" ), func () {
43+ client = redis .NewUniversalClient (& redis.UniversalOptions {
44+ Addrs : cluster .addrs (),
45+ Protocol : 3 ,
46+ UnstableResp3 : true ,
47+ })
48+ Expect (client .Ping (ctx ).Err ()).NotTo (HaveOccurred ())
49+ a := func () { client .FTInfo (ctx , "all" ).Result () }
50+ Expect (a ).ToNot (Panic ())
51+ })
52+
53+ It ("connect to clusters with ClusterClient and UnstableResp3" , Label ("NonRedisEnterprise" ), func () {
54+ client = redis .NewClusterClient (& redis.ClusterOptions {
55+ Addrs : cluster .addrs (),
56+ Protocol : 3 ,
57+ UnstableResp3 : true ,
58+ })
59+ Expect (client .Ping (ctx ).Err ()).NotTo (HaveOccurred ())
60+ a := func () { client .FTInfo (ctx , "all" ).Result () }
61+ Expect (a ).ToNot (Panic ())
62+ })
4163})
You can’t perform that action at this time.
0 commit comments