Add --no-progress-bar option to commands

This commit is contained in:
Stéphane Brunner
2021-04-18 15:56:00 +02:00
parent 0c4f69502d
commit dc410ff566
10 changed files with 83 additions and 21 deletions

View File

@@ -20,13 +20,13 @@ def index_optimize():
writer.commit(optimize=True)
def index_reindex():
def index_reindex(progress_bar_disable=False):
documents = Document.objects.all()
ix = index.open_index(recreate=True)
with AsyncWriter(ix) as writer:
for document in tqdm.tqdm(documents):
for document in tqdm.tqdm(documents, disable=progress_bar_disable):
index.update_document(writer, document)