Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
feat: --redis_disable_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jan 10, 2024
1 parent 723e667 commit b5b8670
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
7 changes: 7 additions & 0 deletions cli/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
})
}

Expand Down
5 changes: 5 additions & 0 deletions redis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -50,6 +52,7 @@ func NewRedisConfig() RedisConfig {
SentinelDiscoveryInterval: 30,
TLSVerify: false,
MaxReconnectAttempts: 5,
DisableCache: false,
}
}

Expand Down Expand Up @@ -95,6 +98,8 @@ func (config *RedisConfig) ToRueidisOptions() (options *rueidis.ClientOption, er
options.TLSConfig.InsecureSkipVerify = !config.TLSVerify
}

options.DisableCache = config.DisableCache

return options, nil
}

Expand Down

0 comments on commit b5b8670

Please sign in to comment.