-
Notifications
You must be signed in to change notification settings - Fork 113
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
Activate Statcache #2329
Activate Statcache #2329
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
831e6d7
to
dbe3605
Compare
remove += "!" + res.StorageId + "!" + res.OpaqueId | ||
} | ||
|
||
for _, key := range cache.GetKeys() { |
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.
O(n)? It might be a niche, but couldn't this be O(1)? 🤔
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.
Maybe. But I'm not sure. We need to loop over all keys so we can check for prefixes. Any ideas?
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.
what he said ;-)
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.
not really, I'd argue about using the OpaqueID as keys so it is a 1:1 match, but I think this is totally out of the scope of this. So you are forced to do this gymnastics around that 😓 because I doubt ttlcache is expressive enough to support queries to it.
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.
It isn't unfortunately. Removing keys by opaqueid doesn't work, because I need to have the option to remove all keys of a user, so we anyways loop over all keys.
No description provided.