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

Activate Statcache #2329

Merged
merged 18 commits into from
Dec 8, 2021
Merged

Activate Statcache #2329

merged 18 commits into from
Dec 8, 2021

Conversation

kobergj
Copy link
Contributor

@kobergj kobergj commented Dec 6, 2021

No description provided.

@update-docs
Copy link

update-docs bot commented Dec 6, 2021

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.

@kobergj kobergj marked this pull request as ready for review December 8, 2021 13:44
@kobergj kobergj requested review from butonic and refs and removed request for labkode, glpatcern and ishank011 December 8, 2021 13:45
remove += "!" + res.StorageId + "!" + res.OpaqueId
}

for _, key := range cache.GetKeys() {
Copy link
Member

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)? 🤔

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what he said ;-)

Copy link
Member

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.

Copy link
Contributor Author

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.

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.

3 participants