-
Notifications
You must be signed in to change notification settings - Fork 75
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
Contentful/cache size limit #1642
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpinol
force-pushed
the
contentful/cache-size-limit
branch
2 times, most recently
from
June 16, 2021 05:13
fc447f8
to
69c5a7b
Compare
dpinol
force-pushed
the
contentful/memoizer
branch
from
June 16, 2021 07:36
51bcd2b
to
7ff7245
Compare
dpinol
force-pushed
the
contentful/cache-size-limit
branch
5 times, most recently
from
June 16, 2021 10:01
420d45f
to
7ee38d3
Compare
dpinol
requested review from
vanbasten17,
asastre,
elozano98,
guinii and
marcpdw
June 16, 2021 10:02
asastre
approved these changes
Jun 18, 2021
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.
Nice one!
dpinol
force-pushed
the
contentful/memoizer
branch
from
June 18, 2021 09:10
7ff7245
to
63dca40
Compare
dpinol
force-pushed
the
contentful/cache-size-limit
branch
from
June 18, 2021 09:11
7ee38d3
to
6d56b17
Compare
dpinol
force-pushed
the
contentful/cache-size-limit
branch
2 times, most recently
from
June 18, 2021 09:20
a263128
to
51bf352
Compare
Cache renamed to InMemoryCache and moved to its own file
Memoizer to use connect ContentfulOptions's logger
dpinol
force-pushed
the
contentful/cache-size-limit
branch
from
June 18, 2021 10:32
51bf352
to
ede58d1
Compare
ericmarcos
approved these changes
Jun 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #1639 .⚠️ Please review it first
Description
#1639 created fallback cache decorator around Contentful API which remembers forever the last successful invocation for each combination of arguments, and use its result whenever Contentful fails.
This PR adds a limit in the in memory cache size to avoid memory overflows.
Context
In case any bot adds arguments with non repeated values, the cache could grow infinitely.
Approach taken / Explain the design
To document / Usage example
The contentful plugin by default uses memoization to remember forever the last successful invocation for each combination of arguments, and use its result whenever Contentful fails. To limit the amount of memory
Testing
The pull request...