aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/crawler.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py
index f7b8ef49..f2ae1599 100644
--- a/pyaggr3g470r/crawler.py
+++ b/pyaggr3g470r/crawler.py
@@ -192,8 +192,9 @@ def insert_database(user, feed):
@asyncio.coroutine
def init_process(user, feed):
- data = yield from asyncio.async(insert_database(user, feed))
+ articles = yield from asyncio.async(insert_database(user, feed))
#print('inserted articles for {}'.format(feed.title))
+ return articles
def retrieve_feed(user, feed_id=None):
"""
@@ -212,8 +213,9 @@ def retrieve_feed(user, feed_id=None):
# 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)
+ tasks = [init_process(user, feed) for feed in feeds]
+ #tasks = [asyncio.async(init_process(user, feed)) for feed in feeds]
+ loop.run_until_complete(asyncio.wait(tasks))
"""
# 3 - Indexation
bgstack15