introduct --no-process to clearmapcache command
This commit is contained in:
parent
676c127014
commit
f8e5e4dc31
1 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,8 @@ class Command(BaseCommand):
|
||||||
help=_('incluce all history as well'))
|
help=_('incluce all history as well'))
|
||||||
parser.add_argument('--include-geometries', action='store_const', const=True, default=False,
|
parser.add_argument('--include-geometries', action='store_const', const=True, default=False,
|
||||||
help=_('incluce all geometries as well'))
|
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):
|
def handle(self, *args, **options):
|
||||||
from c3nav.mapdata.models import MapUpdate
|
from c3nav.mapdata.models import MapUpdate
|
||||||
|
@ -34,7 +36,7 @@ class Command(BaseCommand):
|
||||||
os.remove(os.path.join(settings.CACHE_ROOT, filename))
|
os.remove(os.path.join(settings.CACHE_ROOT, filename))
|
||||||
logger.info('Base history deleted.')
|
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...'))
|
print(_('You don\'t have celery installed, so we will run processupdates now...'))
|
||||||
try:
|
try:
|
||||||
process_map_updates()
|
process_map_updates()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue