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

[MEX-699] In-memory cache service with true ttl cache #1573

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented Feb 26, 2025

Reasoning

  • the current cache service implementation from sdk-nestjs package uses an LRU cache for in-memory caching. This means local TTL values provided are not enforced and cause extra remote cache requests

Proposed Changes

  • install ttlcache package
  • custom cache module using redis cache service from sdk-nestjs and in-memory cache service using ttlcache
  • update imports for cache service
  • update missing ttl values

How to test

  • N/A

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 68.94410% with 50 lines in your changes missing coverage. Please review.

Project coverage is 52.85%. Comparing base (3821301) to head (8261f6b).
Report is 16 commits behind head on development.

Files with missing lines Patch % Lines
src/services/caching/cache.service.ts 46.83% 38 Missing and 4 partials ⚠️
src/services/caching/in.memory.cache.service.ts 73.33% 2 Missing and 6 partials ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1573      +/-   ##
===============================================
+ Coverage        52.83%   52.85%   +0.02%     
===============================================
  Files              271      275       +4     
  Lines            10756    10884     +128     
  Branches           852      870      +18     
===============================================
+ Hits              5683     5753      +70     
- Misses            4309     4351      +42     
- Partials           764      780      +16     
Flag Coverage Δ
unittests 52.85% <68.94%> (+0.02%) ⬆️

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.

@mad2sm0key mad2sm0key marked this pull request as ready for review February 27, 2025 08:26
EmanuelMiron
EmanuelMiron previously approved these changes Feb 27, 2025
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.

2 participants