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

PERF: static id for like post action type #305

Merged
merged 2 commits into from
Aug 15, 2024
Merged

PERF: static id for like post action type #305

merged 2 commits into from
Aug 15, 2024

Conversation

lis2
Copy link
Contributor

@lis2 lis2 commented Aug 15, 2024

Before flags were in the database, PostActionType.types were stored in memory and getting PostActionType.types[:like] was a very cheap operation.

Now, PostActionType is cached in Redis and we should try to avoid sending too many requests, especially that id for like is always 2.

Before flags were in the database, PostActionType.types were stored in memory and getting `PostActionType.types[:like]` was a very cheap operation.

Now, PostActionType is cached in Redis and we should try to avoid sending too many requests, especially that if for `like` is always `2`.
@lis2 lis2 changed the title PERF: static like id PERF: static id for like post action type Aug 15, 2024
@lis2 lis2 merged commit 201b4d9 into main Aug 15, 2024
5 checks passed
@lis2 lis2 deleted the static-like branch August 15, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants