Skip to content

Commit 9e05a7c

Browse files
committed
fix: add unstableresp3 to cluster client
1 parent 0b34b19 commit 9e05a7c

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

osscluster.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

99102
func (opt *ClusterOptions) init() {

universal.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

universal_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,15 @@ var _ = Describe("UniversalClient", func() {
3838
})
3939
Expect(client.Ping(ctx).Err()).NotTo(HaveOccurred())
4040
})
41+
42+
It("should connect to clusters with 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+
_, err := client.FTInfo(ctx, "test").Result()
50+
Expect(err).ToNot(HaveOccurred())
51+
})
4152
})

0 commit comments

Comments
 (0)