set mapdata:last_update only if we are saving a new map update

This commit is contained in:
Laura Klünder 2017-12-14 00:23:58 +01:00
parent ab391e9a4c
commit 9564d92ec3

View file

@ -149,11 +149,11 @@ class MapUpdate(models.Model):
from c3nav.mapdata.utils.cache.changes import changed_geometries
pickle.dump(changed_geometries, open(self._changed_geometries_filename(), 'wb'))
transaction.on_commit(
lambda: cache.delete('mapdata:last_update')
)
if new and settings.HAS_CELERY:
if new:
transaction.on_commit(
lambda: process_map_updates.delay()
lambda: cache.delete('mapdata:last_update')
)
if settings.HAS_CELERY:
transaction.on_commit(
lambda: process_map_updates.delay()
)