introduct --no-process to clearmapcache command

This commit is contained in:
Laura Klünder 2019-12-20 17:44:27 +01:00
parent 676c127014
commit f8e5e4dc31

View file

@ -17,6 +17,8 @@ class Command(BaseCommand):
help=_('incluce all history as well'))
parser.add_argument('--include-geometries', action='store_const', const=True, default=False,
help=_('incluce all geometries as well'))
parser.add_argument('--no-process', action='store_const', const=True, default=False,
help=_('don\'t run processupdates if celery is not setup'))
def handle(self, *args, **options):
from c3nav.mapdata.models import MapUpdate
@ -34,7 +36,7 @@ class Command(BaseCommand):
os.remove(os.path.join(settings.CACHE_ROOT, filename))
logger.info('Base history deleted.')
if not settings.HAS_CELERY:
if not settings.HAS_CELERY and not options['no_process']:
print(_('You don\'t have celery installed, so we will run processupdates now...'))
try:
process_map_updates()