remove delete_old_cached_tiles task because new caching does not need this
This commit is contained in:
parent
6b6e3afa7b
commit
506b959946
2 changed files with 0 additions and 21 deletions
|
@ -7,8 +7,6 @@ from django.utils.http import int_to_base36
|
|||
from django.utils.timezone import make_naive
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from c3nav.mapdata.tasks import delete_old_cached_tiles
|
||||
|
||||
|
||||
class MapUpdate(models.Model):
|
||||
"""
|
||||
|
@ -75,4 +73,3 @@ class MapUpdate(models.Model):
|
|||
LevelRenderData.rebuild()
|
||||
|
||||
cache.set('mapdata:last_update', self.to_tuple, 900)
|
||||
delete_old_cached_tiles.apply_async(countdown=5)
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
import os
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from c3nav.celery import app
|
||||
|
||||
|
||||
@app.task()
|
||||
def delete_old_cached_tiles(*args, **kwargs):
|
||||
from c3nav.mapdata.models import MapUpdate
|
||||
cache_key = MapUpdate.current_cache_key()
|
||||
|
||||
for folder in os.listdir(settings.TILES_ROOT):
|
||||
if folder == cache_key:
|
||||
continue
|
||||
fullpath = os.path.join(settings.TILES_ROOT, folder)
|
||||
if os.path.isdir(fullpath):
|
||||
os.system('rm -rf '+fullpath)
|
Loading…
Add table
Add a link
Reference in a new issue