1
0
mirror of https://github.com/redis/go-redis.git synced 2025-09-02 22:01:16 +03:00

chore(client): fix UniversalOptions miss ReadBufferSize and WriteBufferSize options (#3485)

Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
This commit is contained in:
cxljs
2025-08-18 20:46:31 +08:00
committed by GitHub
parent d2ad801ba2
commit 8336c44404

View File

@@ -61,6 +61,20 @@ type UniversalOptions struct {
WriteTimeout time.Duration
ContextTimeoutEnabled bool
// ReadBufferSize is the size of the bufio.Reader buffer for each connection.
// Larger buffers can improve performance for commands that return large responses.
// Smaller buffers can improve memory usage for larger pools.
//
// default: 256KiB (262144 bytes)
ReadBufferSize int
// WriteBufferSize is the size of the bufio.Writer buffer for each connection.
// Larger buffers can improve performance for large pipelines and commands with many arguments.
// Smaller buffers can improve memory usage for larger pools.
//
// default: 256KiB (262144 bytes)
WriteBufferSize int
// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
PoolFIFO bool
@@ -143,6 +157,9 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
WriteTimeout: o.WriteTimeout,
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
ReadBufferSize: o.ReadBufferSize,
WriteBufferSize: o.WriteBufferSize,
PoolFIFO: o.PoolFIFO,
PoolSize: o.PoolSize,
@@ -200,6 +217,9 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
WriteTimeout: o.WriteTimeout,
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
ReadBufferSize: o.ReadBufferSize,
WriteBufferSize: o.WriteBufferSize,
PoolFIFO: o.PoolFIFO,
PoolSize: o.PoolSize,
PoolTimeout: o.PoolTimeout,
@@ -250,6 +270,9 @@ func (o *UniversalOptions) Simple() *Options {
WriteTimeout: o.WriteTimeout,
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
ReadBufferSize: o.ReadBufferSize,
WriteBufferSize: o.WriteBufferSize,
PoolFIFO: o.PoolFIFO,
PoolSize: o.PoolSize,
PoolTimeout: o.PoolTimeout,