aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-27 09:51:10 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-27 09:51:10 +0100
commit679d0d69d1c12dc44e5a2c21ede04a0fe29fd934 (patch)
tree03bed7c7610fbc090abef256713a9be6b99e0f8e
parentRederict to the page edit_feed. (diff)
downloadnewspipe-679d0d69d1c12dc44e5a2c21ede04a0fe29fd934.tar.gz
newspipe-679d0d69d1c12dc44e5a2c21ede04a0fe29fd934.tar.bz2
newspipe-679d0d69d1c12dc44e5a2c21ede04a0fe29fd934.zip
No need to test explicitly if the article is already in the database since the 'link' MongoEngine field is unique.
-rw-r--r--pyaggr3g470r/feedgetter.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py
index e8c8b7d7..cfad4f0d 100644
--- a/pyaggr3g470r/feedgetter.py
+++ b/pyaggr3g470r/feedgetter.py
@@ -101,10 +101,6 @@ class FeedGetter(object):
except:
pyaggr3g470r_log.warning("Unable to get the real URL of " + article.link)
real_url = article.link
-
- if models.Article.objects(link=real_url).first() != None:
- # if article already in the database continue with the next article
- continue
description = ""
article_title = ""
@@ -135,6 +131,7 @@ class FeedGetter(object):
article.save()
pyaggr3g470r_log.info("New article %s (%s) added." % (article_title, real_url))
except Exception as e:
+ # article already retrieved (continue with the nex article)
pyaggr3g470r_log.error("Error when inserting article in database: " + str(e))
continue
articles.append(article)
@@ -144,7 +141,7 @@ class FeedGetter(object):
search.add_to_index([article], feed)
except Exception as e:
pyaggr3g470r_log.error("Whoosh error.")
- continue
+ pass
# email notification
if conf.MAIL_ENABLED and feed.email_notification:
bgstack15