diff --git a/common/config.go b/common/config.go index 008d021d..6f49cbe2 100644 --- a/common/config.go +++ b/common/config.go @@ -63,17 +63,19 @@ type TLSConfig struct { } type RedisConnectorConfig struct { - Addr string `yaml:"addr" json:"addr"` - Password string `yaml:"password" json:"password"` - DB int `yaml:"db" json:"db"` - TLS *TLSConfig `yaml:"tls" json:"tls"` + Addr string `yaml:"addr" json:"addr"` + Password string `yaml:"password" json:"password"` + DB int `yaml:"db" json:"db"` + TLS *TLSConfig `yaml:"tls" json:"tls"` + ConnPoolSize int `yaml:"connPoolSize" json:"connPoolSize"` } func (r *RedisConnectorConfig) MarshalJSON() ([]byte, error) { return sonic.Marshal(map[string]interface{}{ - "addr": r.Addr, - "password": "REDACTED", - "db": r.DB, + "addr": r.Addr, + "password": "REDACTED", + "db": r.DB, + "connPoolSize": r.ConnPoolSize, }) } diff --git a/data/redis.go b/data/redis.go index 366a9442..49c21dcc 100644 --- a/data/redis.go +++ b/data/redis.go @@ -67,6 +67,7 @@ func (r *RedisConnector) connect(ctx context.Context, cfg *common.RedisConnector Addr: cfg.Addr, Password: cfg.Password, DB: cfg.DB, + PoolSize: cfg.ConnPoolSize, } if cfg.TLS != nil && cfg.TLS.Enabled {