This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Add redis caching to getting user notifications and projects [MOD-540] #723
Merged
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
Draft because I haven't tested this much yet and still need to. I'm hoping to write automated tests around the invalidation conditions using #719 |
OmegaJak
commented
Oct 3, 2023
thesuzerain
reviewed
Oct 3, 2023
Merged
# Conflicts: # src/database/models/project_item.rs # src/database/models/user_item.rs # src/routes/v2/project_creation.rs # src/routes/v2/teams.rs
# Conflicts: # sqlx-data.json # src/database/models/project_item.rs
thesuzerain
suggested changes
Oct 11, 2023
thesuzerain
approved these changes
Oct 12, 2023
Geometrically
approved these changes
Oct 12, 2023
thesuzerain
pushed a commit
that referenced
this pull request
Dec 5, 2023
#723) * Add redis caching to getting a user's project ids * Run `cargo sqlx prepare` to update the sqlx-data.json * Add redis caching for getting user notifications * Fix new clippy warnings * Remove log that shouldn't have been committed * Batch insert of notifications (untested) * sqlx prepare... * Fix merge conflict things and use new redis struct * Fix bug with calling delete_many without any elements (caught by tests) * cargo sqlx prepare * Add tests around cache invalidation (and fix bug they caught!) * Some test reorg based on code review suggestions
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Specifically:
both of these now cache their results in redis.
Cases I could think of that the user projects cache needs invalidation:
Cases I could think of that the user notifications cache needs invalidation: