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

Why does DJANGO_REDIS_CONNECTION_FACTORY need to be a global django setting ? #619

Closed
vedantpuri opened this issue Oct 20, 2022 · 5 comments

Comments

@vedantpuri
Copy link

Context

We use django-redis for our project and I am in a situation where I need to make only one of my caches sentineled.
Ideally the others should also be converted but due to time constraints and other reasoning based on usage we want to convert only one for now.

Question

When trying to change this I noticed that this setting is global, which means that all my caches need to be sentineled for this to work. I am not exactly sure why this is global and/or if this could be moved into OPTIONS per cache to provide more flexibility.

@WisdomPill
Copy link
Member

WisdomPill commented Oct 21, 2022

Hello @vedantpuri,

I see your issue, I think it's a valid point so we should have a pool per cache entry in settings... would you like to create a PR for this?

It should be quite simple, just pass CONNECTION_FACTORY from options and feed it to pool.get_connection_factory(options=self._options) here as path and the trick is done.

If you do it yourself I would be glad to review and release a new version pretty quickly.

Otherwise I can't promise I can do it reasonably fast as I don't have much time to dedicate to open source lately

@vedantpuri
Copy link
Author

Sure! Here is a proposal:
#620

@RealFatCat
Copy link
Contributor

@WisdomPill hi, can you look at #680 please?

@RealFatCat
Copy link
Contributor

@WisdomPill can we get a release with this feature?

@WisdomPill
Copy link
Member

I released it yesterday, thanks @RealFatCat for the PR! 😄

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

No branches or pull requests

3 participants