From 0bcf3b50304dc2159e9005b78000f212edd2d4bf Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 15 Jul 2013 10:01:24 +0200 Subject: [PATCH] Remove stale indexing bits. --- apps/catalogue/models/listeners.py | 8 ++------ apps/pdcounter/models.py | 7 +------ requirements.txt | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/catalogue/models/listeners.py b/apps/catalogue/models/listeners.py index cb106166e..788957e14 100644 --- a/apps/catalogue/models/listeners.py +++ b/apps/catalogue/models/listeners.py @@ -63,9 +63,5 @@ if not settings.NO_SEARCH_INDEX: """ remove the book from search index, when it is deleted.""" import search idx = search.Index() - idx.open(timeout=10000) # 10 seconds timeout. - try: - idx.remove_book(instance) - idx.index_tags() - finally: - idx.close() + idx.remove_book(instance) + idx.index_tags() diff --git a/apps/pdcounter/models.py b/apps/pdcounter/models.py index 50eb43e1f..1e441ac64 100644 --- a/apps/pdcounter/models.py +++ b/apps/pdcounter/models.py @@ -91,13 +91,8 @@ class BookStub(models.Model): if not settings.NO_SEARCH_INDEX: def update_index(sender, instance, **kwargs): import search - print "update pd index %s [update %s]" % (instance, 'created' in kwargs) idx = search.Index() - idx.open() - try: - idx.index_tags(instance, remove_only=not 'created' in kwargs) - finally: - idx.close() + idx.index_tags(instance, remove_only=not 'created' in kwargs) post_delete.connect(update_index, Author) post_delete.connect(update_index, BookStub) diff --git a/requirements.txt b/requirements.txt index 572251ae4..d6355f2cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -52,7 +52,7 @@ pyenchant # OAI-PMH pyoai -egenix-mx-base +## egenix-mx-base # Doesn't play nice with mx in dist-packages. sunburnt django-getpaid>=1.4,<1.5 -- 2.20.1