Skip to content

Commit

Permalink
Use resp2 for tair
Browse files Browse the repository at this point in the history
  • Loading branch information
yangbodong22011 committed Jul 10, 2024
1 parent 138b497 commit 423dd78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tair/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func redisOptions() *redis.Options {
PoolSize: 10,
PoolTimeout: 30 * time.Second,
ConnMaxIdleTime: time.Minute,
Protocol: 2,
}
}

Expand All @@ -80,6 +81,7 @@ func redisClusterOptions() *redis.ClusterOptions {
PoolSize: 10,
PoolTimeout: 30 * time.Second,
ConnMaxIdleTime: time.Minute,
Protocol: 2,
}
}

Expand Down
1 change: 1 addition & 0 deletions tair/tair.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type TairClient struct {
}

func NewTairClient(opt *redis.Options) *TairClient {
opt.Protocol = 2 // For tair, only resp2 is used
c := TairClient{Client: redis.NewClient(opt)}
c.tairCmdable = c.Process
return &c
Expand Down

0 comments on commit 423dd78

Please sign in to comment.