tileserver should not depend on django

This commit is contained in:
Laura Klünder 2018-12-23 20:00:01 +01:00
parent 7754643c4b
commit f1d5b0ffad
3 changed files with 10 additions and 11 deletions

View file

@ -1,13 +1,4 @@
from django.core.cache import cache
from c3nav.mapdata.utils.cache.accessrestrictions import AccessRestrictionAffected # noqa
from c3nav.mapdata.utils.cache.indexed import GeometryIndexed # noqa
from c3nav.mapdata.utils.cache.maphistory import MapHistory # noqa
from c3nav.mapdata.utils.cache.accessrestrictions import AccessRestrictionAffected # noqa
from c3nav.mapdata.utils.cache.package import CachePackage # noqa
def increment_cache_key(cache_key):
try:
cache.incr(cache_key)
except ValueError:
cache.set(cache_key, 0, None)

View file

@ -0,0 +1,8 @@
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)