fix(web-ui): Add version check cache to reduce GitHub API calls#4932
fix(web-ui): Add version check cache to reduce GitHub API calls#4932roj234 wants to merge 6 commits intoLizardByte:masterfrom
Conversation
|
I'm not sure about caching for a whole day. The limit is 60 requests per hour for unauthenticated requests. I think a 1 hour cache would be okay though so we don't consume more than 2 per hour. |
OK |
|
@roj234 could you please fix the sonar issue? Probably just need to create a helper function to extract some of the logic. |
Add caching for version data to reduce API calls.
Refactor version fetching logic into a separate function.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4932 +/- ##
==========================================
- Coverage 18.17% 18.14% -0.03%
==========================================
Files 109 109
Lines 23545 23545
Branches 10391 10391
==========================================
- Hits 4280 4273 -7
+ Misses 16010 14865 -1145
- Partials 3255 4407 +1152
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
|
Bundle ReportChanges will increase total bundle size by 546 bytes (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sunshine-esmAssets Changed:
Files in
|
|
Could you fix the lint errors and rebase? Then I will test this and if all is good, I'll merge it. |
|



Description
Each time I refresh Sunshine page, It will request Github API twice, and Github API (no api key) have a one-hour limit, which shared with many other projects.
This PR have added an 1 day cache, so that Sunshine UI only request Github API once per day.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage