Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redis ClientManager interface to enable redis database number cus… #3071

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WqyJh
Copy link
Contributor

@WqyJh WqyJh commented Mar 27, 2023

Refactor the getClient(r *Redis) function to interface, thereby enabling users to customize the creation of the go-redis instance. This approach will indirectly support the selection of Redis numbers, addressing the specific requirements of certain users. Notably, we will not alter RedisConf to avoid potential abuse of the database number, which is considered bad practice.

@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Attention: Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.30%. Comparing base (0443464) to head (b960702).
Report is 656 commits behind head on master.

Files with missing lines Patch % Lines
core/stores/redis/redis.go 81.25% 2 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
core/stores/redis/conf.go 100.00% <ø> (ø)
core/stores/redis/redisclientmanager.go 89.28% <100.00%> (+2.32%) ⬆️
core/stores/redis/redis.go 98.69% <81.25%> (-0.18%) ⬇️

... and 2 files with indirect coverage changes

@WqyJh
Copy link
Contributor Author

WqyJh commented Mar 27, 2023

Related #1601, #1779, #1779

@WqyJh
Copy link
Contributor Author

WqyJh commented Dec 18, 2023

Here is a list of issues and PRs related to the support of redis database selection, highlighting the strong demand for this feature within the community. The absence of this capability places a heavy burden on individuals who require it, as they are forced to maintain their own go-zero and merge pull requests. Therefore, please merge this pull request and provide users with a means to select the database. It is important to note that this proposal does not introduce a Db field in RedisConf directly, thus mitigating the risk of abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant