Fix: URL Resolution, Team Stats Query Optimization and Caching#1189
Draft
abdullai-t wants to merge 8 commits intomainfrom
Draft
Fix: URL Resolution, Team Stats Query Optimization and Caching#1189abdullai-t wants to merge 8 commits intomainfrom
abdullai-t wants to merge 8 commits intomainfrom
Conversation
…ove logging behavior
…rl-resolution-bug
…pdate team stats method
…rl-resolution-bug
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1189 +/- ##
=======================================
Coverage 58.40% 58.40%
=======================================
Files 495 496 +1
Lines 36932 36950 +18
=======================================
+ Hits 21570 21581 +11
- Misses 15362 15369 +7 ☔ View full report in Codecov by Sentry. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary / Highlights
This pull request includes several changes to the codebase, focusing on middleware updates, caching improvements, and minor refactoring. The most important changes are listed below:
Middleware Updates:
GateMiddlewareto handle non-existent endpoints with a 404 response insrc/_main_/settings.pyand created the middleware class insrc/api/middlewares/gate_middleware.py. [1] [2]Caching Improvements:
@cached_requestdecorator for severallistmethods in various handler files to improve performance by caching responses. [1] [2] [3] [4] [5]Code Refactoring:
wrapperfunction insrc/api/decorators.pyto use a more efficient caching key and added a check for test mode.src/api/services/team.py.infomethod insrc/database/models.pyto handle cases whereself.communityisNone.Logging Improvements:
src/_main_/utils/massenergize_logger/__init__.py.Minor Fixes:
_get_file_urlto an empty string instead ofNonewhen the image is not present insrc/website/views.py.Details (Give details about what this PR accomplishes, include any screenshots etc)
Testing Steps (Provide details on how your changes can be tested)
Requirements (place an
xin each[ ])Transparency (Project board)