Skip to content

cache._cache undefined - logic error in cache_incr #4

Description

@cansar

Hi,

I tried to use cache._cache in another function and realized that this throws an AttributeError because _cache is not defined and that everything inside the try/except is actually incorrect and the code works because it always goes to the except branch. If you change cache._cache to just be cache it will actually break the code - replacing the whole content of the function by cache.set(key, cache.get(key, 0) + 1, self.expire_after()) fixes it.

Just something to be aware of.

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