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.
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
[Kubernetes secret provider] Add cache for the secrets #3822
[Kubernetes secret provider] Add cache for the secrets #3822
Changes from 28 commits
dadc79b
ea3a100
a71101b
125330f
09ba2b6
4908655
a291bae
9f5b92c
9d94859
6d30148
d7c8756
b3ba219
8913d04
0fcd65a
57ad12c
8533ec4
c65ae20
87f0453
f02823e
97d6c84
0f8d86a
70c16ca
7f40d9c
62862a3
7642f09
ab76805
4f3ab48
044e7d1
8b7da6c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why grab the lock inside of the function to set the new value. Then only 4 lines below grab it again to set the lastAccess time?
Why not just set
lastAccess
inside ofaddToCache
and then return inside of the if statement? That would prevent the need to grab the lock twice for the same key.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.
Because then we would be changing
lastAccess
in two functions, when we don't need it. The logic is thatlastAccess
is only changed when it is required (by calling the get from cache).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.
To me its worse to grab a lock, release the lock, grab the lock again, then release it again all in the same path. It should grab the lock do what it needs to do and release it.