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(requests-result): 🔥 Add ttl to updateRequestsCache #477

Merged
merged 1 commit into from
Aug 12, 2023
Merged

feat(requests-result): 🔥 Add ttl to updateRequestsCache #477

merged 1 commit into from
Aug 12, 2023

Conversation

johnfewell
Copy link
Contributor

Add a ttl parameter to the updateRequestsCache function, allowing users to set an expiration time for each cache record when updating multiple keys. If a ttl value isn't provided, the cache record doesn't expire.

✅ Closes: 471

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently, the updateRequestsCache function updates the cache state for a given set of keys to a specified value. However, it doesn't allow for setting an expiration time for these cache records.

Issue Number: 471

What is the new behavior?

With this update, users can now set a ttl parameter when calling the updateRequestsCache function. This parameter allows for setting an expiration time for each cache record. After the set time has elapsed, the cache record for the key will revert to 'none'. If a ttl value isn't provided, the cache record will persist and won't automatically expire.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

The introduction of the ttl parameter enhances the flexibility and control users have over cache management in their applications. This feature can be particularly useful in scenarios where the validity of data might change over time.

Add a ttl parameter to the updateRequestsCache function, allowing users
to set an expiration time for each cache record when updating multiple
keys. If a ttl value isn't provided, the cache record doesn't expire.

✅ Closes: 471
@stackblitz
Copy link

stackblitz bot commented Aug 12, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal NetanelBasal merged commit c62d9a2 into ngneat:master Aug 12, 2023
1 check passed
@johnfewell johnfewell deleted the feat/requests-cache-tll branch August 12, 2023 18:25
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