aboutsummaryrefslogtreecommitdiff
path: root/src/crawler/classic_crawler.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-11-02 08:37:40 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-11-02 08:37:40 +0100
commit245a1e972deee0329c6254496e45dc1959ab6156 (patch)
treedab805eb0fcf18fca756cf87b0e6316efa81552f /src/crawler/classic_crawler.py
parentOnly set those two options when using SQLAlchemy. (diff)
downloadnewspipe-245a1e972deee0329c6254496e45dc1959ab6156.tar.gz
newspipe-245a1e972deee0329c6254496e45dc1959ab6156.tar.bz2
newspipe-245a1e972deee0329c6254496e45dc1959ab6156.zip
set result to None by default
Diffstat (limited to 'src/crawler/classic_crawler.py')
-rw-r--r--src/crawler/classic_crawler.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crawler/classic_crawler.py b/src/crawler/classic_crawler.py
index d263494f..8d1c499d 100644
--- a/src/crawler/classic_crawler.py
+++ b/src/crawler/classic_crawler.py
@@ -141,8 +141,9 @@ async def insert_database(user, feed):
new_updated_date = dateutil.parser.parse(article['updated'])
except Exception as e:
new_updated_date = existing_article.date
- logger.exception("new_updated_date failed: " + str(e))
- print("new_updated_date failed: " + str(e))
+ print(new_updated_date)
+ logger.exception("new_updated_date failed: ")
+ print("new_updated_date failed: ")
if None is existing_article.updated_date:
existing_article.updated_date = new_updated_date.replace(tzinfo=None)
@@ -174,8 +175,8 @@ async def insert_database(user, feed):
async def init_process(user, feed):
# Fetch the feed and insert new articles in the database
- articles = await insert_database(user, feed)
try:
+ articles = await insert_database(user, feed)
logger.debug('inserted articles for %s', feed.title)
except Exception as e:
print('init_process: ' + str(e))
bgstack15