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

cache.incr does not support tagging #340

Open
BoPeng opened this issue Feb 11, 2025 · 0 comments
Open

cache.incr does not support tagging #340

BoPeng opened this issue Feb 11, 2025 · 0 comments

Comments

@BoPeng
Copy link

BoPeng commented Feb 11, 2025

I am using tags to manage and evict keys based on their tags. However, I noticed that cache.incr does not accept a tag parameter, resulting in all keys created by cache.incr having a None tag.

Current workaround:

try:
    cache.incr(key, delta, default=None)
except KeyError:
    cache.set(key, delta, tag='counter')

Proposed enhancement: It would be more straightforward and efficient if cache.incr could accept a tag parameter, allowing:

cache.incr(key, delta, tag='counter')

This enhancement would simplify the code and ensure consistency in tagging 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

No branches or pull requests

1 participant