-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add TTLConfig #538
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: add TTLConfig #538
Conversation
peternhale
left a comment
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.
@mdonnalley Tests?
peternhale
left a comment
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.
@mdonnalley thanks for writing the tests!
src/config/ttlConfig.ts
Outdated
| const sorted = entries.sort(([, valueA], [, valueB]) => { | ||
| return new Date(valueB.timestamp).getTime() - new Date(valueA.timestamp).getTime(); | ||
| }); | ||
| return sorted[0]; |
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.
empty cache would throw, but it'd be an index out of range?
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.
I think I'd put a test case on the expected empty cache behavior
Adds
TTLConfigclass for use bysf deploy metadata,sf env create scratch,sf env create sandboxExample usage:
[skip-validate-pr]