diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-05-27 14:39:27 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-05-27 14:39:27 +0200 |
commit | a8b2af256b38aeb054d4ce670d6e273006586709 (patch) | |
tree | 00ee9436872d220d62e63e35227b24f8091ab085 | |
parent | Feedpaser is now fixed. (diff) | |
download | newspipe-a8b2af256b38aeb054d4ce670d6e273006586709.tar.gz newspipe-a8b2af256b38aeb054d4ce670d6e273006586709.tar.bz2 newspipe-a8b2af256b38aeb054d4ce670d6e273006586709.zip |
Run the asyncio loop in a try block.
-rw-r--r-- | pyaggr3g470r/crawler.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py index cada119b..8052fb63 100644 --- a/pyaggr3g470r/crawler.py +++ b/pyaggr3g470r/crawler.py @@ -248,7 +248,9 @@ def retrieve_feed(user, feed_id=None): tasks = [asyncio.ensure_future(init_process(user, feed)) for feed in feeds] except: tasks = [init_process(user, feed) for feed in feeds] - loop.run_until_complete(asyncio.wait(tasks)) - loop.close() + try: + loop.run_until_complete(asyncio.wait(tasks)) + finally: + loop.close() logger.info("All articles retrieved. End of the processus.") |