aboutsummaryrefslogtreecommitdiff
path: root/src/manager.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-11-03 13:39:27 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-11-03 13:39:27 +0100
commit955b126903eb46065a1e90a986e6af197481437b (patch)
tree11ecf96023d6f3c136bd83147081df72f5956984 /src/manager.py
parentFixed an error in the logging after the insertion of an article (diff)
downloadnewspipe-955b126903eb46065a1e90a986e6af197481437b.tar.gz
newspipe-955b126903eb46065a1e90a986e6af197481437b.tar.bz2
newspipe-955b126903eb46065a1e90a986e6af197481437b.zip
Some improvements for the manager and the asyncio crawler.
Diffstat (limited to 'src/manager.py')
-rwxr-xr-xsrc/manager.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/manager.py b/src/manager.py
index 47a88339..46f8fe10 100755
--- a/src/manager.py
+++ b/src/manager.py
@@ -3,6 +3,7 @@
import os
import logging
+from datetime import datetime
from werkzeug import generate_password_hash
from bootstrap import application, db, conf, set_logging
from flask_script import Manager
@@ -67,11 +68,17 @@ def fetch_asyncio(user_id=None, feed_id=None):
except:
feed_id = None
+ logger.info('Starting crawler.')
+
+ start = datetime.now()
loop = asyncio.get_event_loop()
for user in users:
- logger.info("Fetching articles for " + user.nickname)
classic_crawler.retrieve_feed(loop, user, feed_id)
loop.close()
+ end = datetime.now()
+
+ logger.info('Crawler finished in {} seconds.' \
+ .format((end - start).seconds))
if __name__ == '__main__':
bgstack15