Repository navigation
feat(redis)!: Redis connections come from the app's config - #15
Closed
arjendevos wants to merge 5 commits into
Closed
arjendevos wants to merge 5 commits into
arjendevos wants to merge 5 commits into
Conversation
The queue and the cache built their Redis connections from REDIS_* or REDIS_<NAME>_* environment variables. The app now registers its connections once, app.WithRedis(config.Redis), and they look theirs up by name; one asked for before that fails with ErrNoConfig, and a name the config lacks is an error. config.RedisConnection gains the mode, addresses, master name and sentinel credentials the environment gave. BREAKING CHANGE: Redis connections need app.WithRedis; REDIS_* is no longer read.
Contributor
Author
|
Folded into #18. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #14. The last of the environment reads in core.
The queue and the cache built their Redis connections from
REDIS_*(orREDIS_<NAME>_*) environment variables. The app now registers its connections once and they look theirs up by name:config.RedisConnectiongains what the environment gave:Mode(config.SingleRedisModeby default,SentinelRedisModeorClusterRedisMode; its type is private, read it withenv.Enum),Addresses(orHostandPortfor one),MasterNameand the sentinel credentials.app.WithRedisfails; a name the config lacks is an error, as is a bad mode, a database outside 0 to 15, or a cluster on another database.config.Queue.Connections.Redis.Connectionandconfig.Cache.Connectionname the one they use, the default when empty.Breaking: Redis connections need
app.WithRedis;REDIS_*is no longer read.Tested:
tests/redis(moved fromredis/) covers no config, the default connection, a named sentinel one, a cluster and each refusal. The live connection test still runs withREDIS_TOPOLOGY_INTEGRATION=1, and passed against a local Redis.