Skip to content

cache.incr does not support tagging #340

@BoPeng

Description

@BoPeng

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions