-
Notifications
You must be signed in to change notification settings - Fork 54
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
Redis backend update #4376
Merged
Merged
Redis backend update #4376
Conversation
This file contains 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
axelstudios
added
the
Feature
Add this label to new features. This will be reflected in the change log when generated.
label
Nov 1, 2023
axelstudios
force-pushed
the
task/update-redis-py
branch
from
November 1, 2023 16:45
4973396
to
2fb533f
Compare
@nllong what do you think? |
nllong
approved these changes
Nov 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Let's bring this up on our next call that users will need to update their local untrack files before we merge down.
|
@dhaley will test this out around Feb12th to make sure it works on stratus before merging. |
axelstudios
force-pushed
the
task/update-redis-py
branch
from
February 9, 2024 22:39
5eb84b6
to
bfad6b7
Compare
axelstudios
force-pushed
the
task/update-redis-py
branch
from
February 9, 2024 23:18
27d5c0f
to
664c714
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature
Add this label to new features. This will be reflected in the change log when generated.
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.
Any background context you want to provide?
The dependency we were using to leverage Redis as the Django/Celery cache (
django-redis-cache
) effectively hasn't been updated since 2020, and requiresredis-py < v4.0
. Redis-py introduced cluster-mode in v4.1.0.What's this PR do?
Drops the
django-redis-cache
dependency in favor ofdjango-redis
, which is compatible with current versions ofredis-py
. This PR also addshiredis
for performance.Once we migrate to Django v4 we can use Django's built-in Redis support going forward.
How should this be manually tested?
pip install -r requirements/base.txt
local_untracked.py
), see the migration steps below to understand what to changeWhat are the relevant tickets?
#4375
BREAKING CHANGE
This updated dependency requires users and deployments to modify their
CACHES
config. Django v4 uses the same syntax, so this is a necessary step regardless.Migration Steps
pip install -r requirements/base.txt
BACKEND
property todjango_redis.cache.RedisCache
LOCATION
property to match the redis-py native URL notation for connection strings, including theredis
protocol and database number. e.g.redis://localhost:6379/1
CELERY_BROKER_URL
setting must also be in the same format, it may be helpful to configure that setting first and then reference it in the cachesLOCATION
parameter.Example migration
In your Django settings file, replace existing code that looks like this:
with this:
For advanced connections, the connection string can also specify SSL, username, and password, e.g.
rediss://username:password@localhost:6379/1