This repository was archived by the owner on Nov 8, 2024. It is now read-only.
Conversation
aarsilv
reviewed
May 1, 2024
Contributor
aarsilv
left a comment
There was a problem hiding this comment.
Just commenting instead of approving as this has exceed my comfort level reading python 😅
| def __init__(self, max_size: int): | ||
| self.__cache: LRUCache = LRUCache(maxsize=max_size) | ||
| def __init__(self): | ||
| self.__cache: Dict[str, T] = {} |
Contributor
There was a problem hiding this comment.
How is this cache used? If it's for assignments I think we do want some sort of eviction
Author
There was a problem hiding this comment.
This cache is used to store the flag configuration. There is no cache for assignments for the Python SDK at the moment.
| from contextlib import contextmanager | ||
|
|
||
| # Copied from: https://www.oreilly.com/library/view/python-cookbook/0596001673/ch06s04.html | ||
| # Adapted from: https://www.oreilly.com/library/view/python-cookbook/0596001673/ch06s04.html |
Author
There was a problem hiding this comment.
I tried that first, it went down a much more complicated path so I just added the contextmanager myself :)
leoromanovsky
approved these changes
May 1, 2024
added 2 commits
May 2, 2024 16:09
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
labels: mergeable
Fixes: #issue
Motivation and Context
Adding a read lock to the
get_flag_keysmethod to ensure we do not hit a race condition. Also:How has this been tested?
Tests pass