From 8f0890d44e9a2a3f0b2c24dd33ae2439eff56022 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 9 Feb 2015 19:48:29 +0100 Subject: bug when the list of feeds to fetch is empty --- pyaggr3g470r/crawler.py | 11 ++++++----- 1 file 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.") -- cgit