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 @@ -90,6 +90,9 @@ type ClusterOptions struct {
9090	DisableIndentity  bool  // Disable set-lib on connect. Default is false. 
9191
9292	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 
9396}
9497
9598func  (opt  * ClusterOptions ) init () {
@@ -304,7 +307,8 @@ func (opt *ClusterOptions) clientOptions() *Options {
304307		// much use for ClusterSlots config).  This means we cannot execute the 
305308		// READONLY command against that node -- setting readOnly to false in such 
306309		// 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 ,
308312	}
309313}
310314
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