File tree 4 files changed +29
-2
lines changed
4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ type Options struct {
154
154
// Add suffix to client name. Default is empty.
155
155
IdentitySuffix string
156
156
157
- // Enable Unstable mode for Redis Search module with RESP3.
157
+ // UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
158
158
UnstableResp3 bool
159
159
}
160
160
Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ type ClusterOptions struct {
90
90
DisableIndentity bool // Disable set-lib on connect. Default is false.
91
91
92
92
IdentitySuffix string // Add suffix to client name. Default is empty.
93
+
94
+ // UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
95
+ UnstableResp3 bool
93
96
}
94
97
95
98
func (opt * ClusterOptions ) init () {
@@ -304,7 +307,8 @@ func (opt *ClusterOptions) clientOptions() *Options {
304
307
// much use for ClusterSlots config). This means we cannot execute the
305
308
// READONLY command against that node -- setting readOnly to false in such
306
309
// situations in the options below will prevent that from happening.
307
- readOnly : opt .ReadOnly && opt .ClusterSlots == nil ,
310
+ readOnly : opt .ReadOnly && opt .ClusterSlots == nil ,
311
+ UnstableResp3 : opt .UnstableResp3 ,
308
312
}
309
313
}
310
314
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
115
115
116
116
DisableIndentity : o .DisableIndentity ,
117
117
IdentitySuffix : o .IdentitySuffix ,
118
+ UnstableResp3 : o .UnstableResp3 ,
118
119
}
119
120
}
120
121
Original file line number Diff line number Diff line change @@ -38,4 +38,26 @@ var _ = Describe("UniversalClient", func() {
38
38
})
39
39
Expect (client .Ping (ctx ).Err ()).NotTo (HaveOccurred ())
40
40
})
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
+ })
41
63
})
You can’t perform that action at this time.
0 commit comments