Add redis database selection#101
Merged
ejsmith merged 6 commits intoFoundatioFx:mainfrom May 19, 2025
Merged
Conversation
|
Teddy ALBINA seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
Author
|
Signer the CLA but it keeps saying it's not the case :/ |
niemyjski
reviewed
May 15, 2025
niemyjski
reviewed
May 15, 2025
niemyjski
reviewed
May 15, 2025
niemyjski
reviewed
May 15, 2025
Member
niemyjski
left a comment
There was a problem hiding this comment.
Thanks a ton for this PR! I left a few comments and would love your thoughts around db constraints.
Member
No worries |
There was a problem hiding this comment.
Pull Request Overview
This PR adds the ability to select a specific Redis database for queues and cache clients. Key changes include:
- Introducing a new nullable DbId property to options classes.
- Adding builder methods (UseDatabase) to set the database index.
- Updating database accessor logic in queue and cache client classes to pass the selected database index.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Foundatio.Redis/Queues/RedisQueueOptions.cs | Added DbId property and UseDatabase builder method for queue options. |
| src/Foundatio.Redis/Queues/RedisQueue.cs | Updated constructor and Database property to use the provided DbId. |
| src/Foundatio.Redis/Cache/RedisHybridCacheClientOptions.cs | Added UseDatabase builder method in cache client options. |
| src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs | Integrated the DbId update in the client configuration chain. |
| src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs | Added DbId property and UseDatabase builder method in cache options. |
| src/Foundatio.Redis/Cache/RedisCacheClient.cs | Updated DbId assignment, Database property, and related calls to use DbId. |
Database property is no longer nullable and its default value is set to -1 The UseDatabase methods checks if the database identifier is valid Remove _dbId and replace it with _options.Database
ejsmith
requested changes
May 15, 2025
Contributor
Author
|
CLA signature fixed 🥳🥳🥳🥳 |
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.
Actually is it not possible to setup the redis database to use. This evolution aims to add this possibility.