From cc92bc3d4e72c8e50e0478ada930425e14701307 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 13 Apr 2014 00:42:56 +0200 Subject: Whoosh search is now working (but not on Heroku). --- pyaggr3g470r/feedgetter.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pyaggr3g470r/feedgetter.py') diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py index cf0cd44c..c5bac3c8 100644 --- a/pyaggr3g470r/feedgetter.py +++ b/pyaggr3g470r/feedgetter.py @@ -171,13 +171,13 @@ class FeedGetter(object): user_id=self.user.id, feed_id=feed.id) articles.append(article) - # add the article to the Whoosh index - """ - try: - search.add_to_index([article], feed) - except Exception as e: - pyaggr3g470r_log.error("Whoosh error.") - pass""" + # add the article to the Whoosh index only if we are not on Heroku + if not conf.ON_HEROKU: + try: + search.add_to_index([article], feed) + except Exception as e: + pyaggr3g470r_log.error("Whoosh error.") + pass # email notification if conf.MAIL_ENABLED and feed.email_notification: -- cgit