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

Hotfix: Cache latest versions #535

Merged
merged 5 commits into from
Jun 5, 2024
Merged

Hotfix: Cache latest versions #535

merged 5 commits into from
Jun 5, 2024

Conversation

dmannarino
Copy link
Member

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

  • get_latest_version is called A LOT, and every time it's called it makes a DB call.

Issue Number: N/A

What is the new behavior?

  • Cache the latest version value to reduce DB calls. Invalidate cache in new and update version functions, but set a TTL of 1 hour in case I missed something.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.60%. Comparing base (09fc8ab) to head (38df9a5).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #535   +/-   ##
=======================================
  Coverage   81.59%   81.60%           
=======================================
  Files         125      125           
  Lines        5619     5622    +3     
=======================================
+ Hits         4585     4588    +3     
  Misses       1034     1034           
Flag Coverage Δ
unittests 81.60% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmannarino dmannarino merged commit 38b5d68 into master Jun 5, 2024
2 checks passed
@dmannarino dmannarino deleted the hotfix_cache_latest branch June 5, 2024 20:34
@jterry64 jterry64 restored the hotfix_cache_latest branch June 14, 2024 17:15
@jterry64 jterry64 deleted the hotfix_cache_latest branch June 14, 2024 17:15
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