From: Marcin Koziej Date: Thu, 27 Oct 2011 13:34:31 +0000 (+0200) Subject: index indictor X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/8ebbecdeab595766e659a0116245da8a925bdfeb index indictor --- diff --git a/apps/search/index.py b/apps/search/index.py index d539257ee..f5489a5ca 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -9,6 +9,7 @@ from lucene import SimpleFSDirectory, IndexWriter, File, Field, \ HashSet, BooleanClause, Term, CharTermAttribute, \ PhraseQuery, StringReader # KeywordAnalyzer +import sys import os import errno from librarian import dcparser @@ -268,8 +269,13 @@ class ReusableIndex(Index): @staticmethod def close_reusable(): if ReusableIndex.index is not None: + all_jobs = len(ReusableIndex.pool_jobs) + waited=1 for job in ReusableIndex.pool_jobs: + sys.stdout.write("\rWaiting for search index job: %d/%d..." % job.wait() + waited+=1 + print("Indexing done.") ReusableIndex.pool.close() ReusableIndex.index.optimize()