-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Update sentry_app queries to use the read replica #93081
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
base: master
Are you sure you want to change the base?
Conversation
❌ 305 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
87373de
to
2ff206f
Compare
def get_sentry_app_by_id(self, *, id: int) -> RpcSentryApp | None: | ||
try: | ||
sentry_app = SentryApp.objects.get(id=id) | ||
sentry_app = SentryApp.objects.using_replica().get(id=id) |
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.
Have you considered using get_from_cache()
on these id reads? It might be possible to get a good cache hit rate on these and skip postgres entirely most of the time.
WIP. need to double check these are safe operations