From 6b8dcb7240cde47c3a07ada8edfbf621fd14aa1a Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 2 Feb 2012 10:28:25 -0400 Subject: [PATCH] Update the index mirroring rebuild tool --- apps/document_indexing/tools.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/document_indexing/tools.py b/apps/document_indexing/tools.py index 07e62c83ce..71837b0930 100644 --- a/apps/document_indexing/tools.py +++ b/apps/document_indexing/tools.py @@ -2,15 +2,17 @@ from __future__ import absolute_import from documents.models import Document -from .models import IndexInstanceNode, DocumentRenameCount +from .models import Index, IndexInstanceNode, DocumentRenameCount from .filesystem import fs_delete_directory_recusive from .api import update_indexes def do_rebuild_all_indexes(): - fs_delete_directory_recusive() - IndexInstanceNode.objects.delete() - DocumentRenameCount.objects.delete() + for index in Index.objects.all(): + fs_delete_directory_recusive(index) + + IndexInstanceNode.objects.all().delete() + DocumentRenameCount.objects.all().delete() for document in Document.objects.all(): update_indexes(document)