clear all cache when lazy is not used #13544

This commit is contained in:
Abhimanyu Saharan 2023-08-24 17:50:50 +05:30 committed by Jeremy Stretch
parent 506884bc4d
commit 88bf82be05

View File

@ -69,10 +69,7 @@ class Command(BaseCommand):
if not kwargs['lazy']:
self.stdout.write('Clearing cached values... ', ending='')
self.stdout.flush()
content_types = [
ContentType.objects.get_for_model(model) for model in indexers.keys()
]
deleted_count = search_backend.clear(content_types)
deleted_count = search_backend.clear()
self.stdout.write(f'{deleted_count} entries deleted.')
# Index models