-
Notifications
You must be signed in to change notification settings - Fork 14
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(javascript): add cache TTL and fix support message #2474
Conversation
✅ Deploy Preview for api-clients-automation ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹
Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter( | ||
([, cacheItem]) => { | ||
const currentTimestamp = new Date().getTime(); | ||
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens when timeToLive
is null ? shouldn't you just early return instead of doing the addition here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are already filtered
I did not touched the actual implementation just in case we broke something non tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah it's just above I missed it
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/DI-1741
closes #2470
closes #1489
Changes included:
this PR port changes from the v4 version: