diff --git a/CHANGELOG.md b/CHANGELOG.md index a2a8b5a5..269c10d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +- Add `--redis_disable_cache` option to disable client-side caching (not supported by some Redis providers). ([@palkan][]) + - Return support for an scheme omitted IP address in RPC_HOST. ([@ardecvz][]) For example, `127.0.0.1:50051/anycable`. diff --git a/cli/options.go b/cli/options.go index 2bbf0f4f..635fb2a8 100644 --- a/cli/options.go +++ b/cli/options.go @@ -391,6 +391,13 @@ func redisCLIFlags(c *config.Config) []cli.Flag { Value: c.Redis.TLSVerify, Destination: &c.Redis.TLSVerify, }, + + &cli.BoolFlag{ + Name: "redis_disable_cache", + Usage: "Disable client-side caching", + Value: c.Redis.DisableCache, + Destination: &c.Redis.DisableCache, + }, }) } diff --git a/redis/config.go b/redis/config.go index 624cefce..6c5db315 100644 --- a/redis/config.go +++ b/redis/config.go @@ -31,6 +31,8 @@ type RedisConfig struct { TLSVerify bool // Max number of reconnect attempts MaxReconnectAttempts int + // Disable client-side caching + DisableCache bool // List of hosts to connect hosts []string @@ -50,6 +52,7 @@ func NewRedisConfig() RedisConfig { SentinelDiscoveryInterval: 30, TLSVerify: false, MaxReconnectAttempts: 5, + DisableCache: false, } } @@ -95,6 +98,8 @@ func (config *RedisConfig) ToRueidisOptions() (options *rueidis.ClientOption, er options.TLSConfig.InsecureSkipVerify = !config.TLSVerify } + options.DisableCache = config.DisableCache + return options, nil }