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

Move condition check above potential database queries #11706

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

mitchellhenke
Copy link
Contributor

🛠 Summary of changes

I was looking in NewRelic and saw a transaction that included multiple and potentially unnecessary identical database queries for BackupCodeConfiguration. The culprit appears to be an analytics method that queries for MFA information so it can be logged. The logging was conditional, so we can at least eliminate the query in cases where the conditional is false by bringing the conditional check up and avoiding the method call entirely.

changelog: Internal, Performance, Move condition check above potential database queries
@mitchellhenke mitchellhenke requested a review from a team January 3, 2025 22:09
@mitchellhenke mitchellhenke merged commit ad79ec2 into main Jan 6, 2025
2 checks passed
@mitchellhenke mitchellhenke deleted the mitchellhenke/small-performance-improvement branch January 6, 2025 15:29
matthinz pushed a commit that referenced this pull request Jan 7, 2025
* Move condition check above potential database queries

changelog: Internal, Performance, Move condition check above potential database queries

* rename confirmation analytics method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants