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

Minor refactor of TTL cache (allow nil TTL + get TTL) #3968

Merged
merged 1 commit into from Oct 17, 2023

Conversation

danehlim
Copy link
Contributor

@danehlim danehlim commented Oct 16, 2023

Summary

Currently, TTL cache MUST have a TTL value specified that is limited to the following range: [-9223372036854775808, 9223372036854775807]. This pull request allows for the TTL cache to have nil TTL set (i.e. practically equivalent to ∞ TTL).

Also, this pull request adds a GetTTL method for TTL cache. This method is currently mainly used in testing and compliments the SetTTL method that was added as part of #3953.

Implementation details

  • Define new struct type TTL and use in favor of current type time.Duration (which has underlying type int64)
  • Add GetTTL method for TTL cache
  • Clean up code comments (mainly make punctuation consistent/correct typos)
  • Regenerate async package mocks

Testing

Unit, integration, and functional tests.

New tests cover the changes: existing tests updated

Description for the changelog

Minor refactor of TTL cache (allow nil TTL + get TTL)

Does this PR include breaking model changes? If so, Have you added transformation functions?
No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@danehlim danehlim changed the title Minor refactor of TTL cache (allow no TTL + get TTL) Minor refactor of TTL cache (allow nil TTL + get TTL) Oct 17, 2023
@danehlim danehlim marked this pull request as ready for review October 17, 2023 17:14
@danehlim danehlim requested a review from a team as a code owner October 17, 2023 17:14
@danehlim danehlim marked this pull request as draft October 17, 2023 17:14
@danehlim danehlim merged commit 4b33664 into aws:dev Oct 17, 2023
38 checks passed
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.

None yet

4 participants