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

Feat/backend/add caching and preloading images #244

Merged
merged 4 commits into from
Jul 27, 2024

Conversation

waveyboym
Copy link
Member

@waveyboym waveyboym commented Jul 27, 2024

Description

This pr introduces some caching mechanism for images:

  1. Make a request for a low res image
  2. A worker in the background will download and cache images thus reducing wait times on request for higher res images
  3. Some database functions had a cache attached them especially booking

Fixes # (issue)
#156

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • A handful of unit tests were written in the cache_methods_unit_test.go file

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@waveyboym waveyboym added For: api This is mainly for the api For: backend This is mainly for the backend code effort: 5 This may require/required hours of work labels Jul 27, 2024
@waveyboym waveyboym self-assigned this Jul 27, 2024
Copy link

codecov bot commented Jul 27, 2024

Codecov Report

Attention: Patch coverage is 49.65517% with 73 lines in your changes missing coverage. Please review.

Project coverage is 59.21%. Comparing base (bed657d) to head (3b77179).
Report is 88 commits behind head on develop.

Files Patch % Lines
occupi-backend/pkg/database/database.go 29.33% 49 Missing and 4 partials ⚠️
occupi-backend/pkg/cache/cache.go 67.74% 12 Missing and 8 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #244      +/-   ##
===========================================
- Coverage    59.60%   59.21%   -0.40%     
===========================================
  Files            8        9       +1     
  Lines         1634     1758     +124     
===========================================
+ Hits           974     1041      +67     
- Misses         622      672      +50     
- Partials        38       45       +7     

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

@waveyboym waveyboym merged commit d2bc8e4 into develop Jul 27, 2024
5 of 8 checks passed
@waveyboym waveyboym deleted the feat/backend/add-caching-and-preloading-images branch July 27, 2024 10:17
@waveyboym waveyboym linked an issue Jul 28, 2024 that may be closed by this pull request
3 tasks
waveyboym added a commit that referenced this pull request Aug 12, 2024
…and-preloading-images

Feat/backend/add caching and preloading images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 5 This may require/required hours of work For: api This is mainly for the api For: backend This is mainly for the backend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Cache database functions
1 participant