refactor: remove redis direct references from proxy/admin servers
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
Cadoles/bouncer/pipeline/pr-master This commit looks good

This commit is contained in:
2025-08-13 16:54:47 +02:00
parent a50f926463
commit ad4f334bc2
16 changed files with 199 additions and 235 deletions

View File

@ -11,33 +11,36 @@ const (
type RedisConfig struct {
Adresses InterpolatedStringSlice `yaml:"addresses"`
Master InterpolatedString `yaml:"master"`
ReadTimeout InterpolatedDuration `yaml:"readTimeout"`
WriteTimeout InterpolatedDuration `yaml:"writeTimeout"`
DialTimeout InterpolatedDuration `yaml:"dialTimeout"`
ReadTimeout *InterpolatedDuration `yaml:"readTimeout"`
WriteTimeout *InterpolatedDuration `yaml:"writeTimeout"`
DialTimeout *InterpolatedDuration `yaml:"dialTimeout"`
LockMaxRetries InterpolatedInt `yaml:"lockMaxRetries"`
RouteByLatency InterpolatedBool `yaml:"routeByLatency"`
ContextTimeoutEnabled InterpolatedBool `yaml:"contextTimeoutEnabled"`
MaxRetries InterpolatedInt `yaml:"maxRetries"`
PingInterval InterpolatedDuration `yaml:"pingInterval"`
PingInterval *InterpolatedDuration `yaml:"pingInterval"`
PoolSize InterpolatedInt `yaml:"poolSize"`
PoolTimeout InterpolatedDuration `yaml:"poolTimeout"`
PoolTimeout *InterpolatedDuration `yaml:"poolTimeout"`
MinIdleConns InterpolatedInt `yaml:"minIdleConns"`
MaxIdleConns InterpolatedInt `yaml:"maxIdleConns"`
ConnMaxIdleTime InterpolatedDuration `yaml:"connMaxIdleTime"`
ConnMaxLifetime InterpolatedDuration `yaml:"connMaxLifeTime"`
ConnMaxIdleTime *InterpolatedDuration `yaml:"connMaxIdleTime"`
ConnMaxLifetime *InterpolatedDuration `yaml:"connMaxLifeTime"`
}
func NewDefaultRedisConfig() RedisConfig {
return RedisConfig{
Adresses: InterpolatedStringSlice{"localhost:6379"},
Master: "",
ReadTimeout: InterpolatedDuration(30 * time.Second),
WriteTimeout: InterpolatedDuration(30 * time.Second),
DialTimeout: InterpolatedDuration(30 * time.Second),
ReadTimeout: NewInterpolatedDuration(30 * time.Second),
WriteTimeout: NewInterpolatedDuration(30 * time.Second),
DialTimeout: NewInterpolatedDuration(30 * time.Second),
PoolTimeout: NewInterpolatedDuration(31 * time.Second),
LockMaxRetries: 10,
MaxRetries: 3,
PingInterval: InterpolatedDuration(30 * time.Second),
PingInterval: NewInterpolatedDuration(30 * time.Second),
ContextTimeoutEnabled: true,
RouteByLatency: true,
ConnMaxIdleTime: NewInterpolatedDuration(1 * time.Minute),
ConnMaxLifetime: NewInterpolatedDuration(5 * time.Minute),
}
}