thunderstore-io / Thunderstore

Thunderstore is a mod database and API for downloading mods. Thunderstore Discord: https://discord.thunderstore.io/
https://thunderstore.io/
GNU Affero General Public License v3.0
138 stars 28 forks source link

Several cache improvements #1003

Closed MythicManiac closed 10 months ago

MythicManiac commented 10 months ago

This PR contains caching for the download URL endpoint and profile storage size check. Additionally, the download log has been moved to a background task as to not block request processing unnecessarily long.

Finally, the management command for clearing caches was updated to support selecting which cache(s) to clear.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (2c9085b) 93.06% compared to head (86d329a) 92.82%.

Files Patch % Lines
...understore/core/management/commands/clear_cache.py 0.00% 14 Missing :warning:
.../thunderstore/repository/views/package/download.py 77.77% 5 Missing and 1 partial :warning:
...ango/thunderstore/modpacks/models/legacyprofile.py 85.71% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1003 +/- ## ========================================== - Coverage 93.06% 92.82% -0.24% ========================================== Files 308 309 +1 Lines 8854 8898 +44 Branches 784 786 +2 ========================================== + Hits 8240 8260 +20 - Misses 507 530 +23 - Partials 107 108 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.