team-3/src/c3nav/mapdata/utils/cache/stats.py

9 lines
174 B
Python
Raw Normal View History

2018-12-23 20:00:01 +01:00
from django.core.cache import cache
def increment_cache_key(cache_key):
try:
cache.incr(cache_key)
except ValueError:
cache.set(cache_key, 0, None)