aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-02-09 19:48:29 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-02-09 19:48:29 +0100
commit8f0890d44e9a2a3f0b2c24dd33ae2439eff56022 (patch)
tree785345909c6cdb0f0a89a494eb701df636a6eead
parentFix bug with pip (diff)
downloadnewspipe-8f0890d44e9a2a3f0b2c24dd33ae2439eff56022.tar.gz
newspipe-8f0890d44e9a2a3f0b2c24dd33ae2439eff56022.tar.bz2
newspipe-8f0890d44e9a2a3f0b2c24dd33ae2439eff56022.zip
bug when the list of feeds to fetch is empty
-rw-r--r--pyaggr3g470r/crawler.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py
index cdbbab8d..a2a0dc4a 100644
--- a/pyaggr3g470r/crawler.py
+++ b/pyaggr3g470r/crawler.py
@@ -203,10 +203,11 @@ def retrieve_feed(user, feed_id=None):
if feed_id is not None:
feeds = [feed for feed in feeds if feed.id == feed_id]
- # 2 - Fetch the feeds.
- loop = asyncio.get_event_loop()
- f = asyncio.wait([init_process(user, feed) for feed in feeds])
- loop.run_until_complete(f)
+ if feeds != []:
+ # 2 - Fetch the feeds.
+ loop = asyncio.get_event_loop()
+ f = asyncio.wait([init_process(user, feed) for feed in feeds])
+ loop.run_until_complete(f)
"""
# 4 - Indexation
@@ -218,4 +219,4 @@ def retrieve_feed(user, feed_id=None):
self.mail_notification(new_articles)
"""
- logger.info("All articles retrieved. End of the processus.") \ No newline at end of file
+ logger.info("All articles retrieved. End of the processus.")
bgstack15