fetch all fb
This commit is contained in:
@@ -5,7 +5,7 @@ from src.database import db_session
|
||||
from mqueues import fetch_queue, compile_queue, put_fetch_queue
|
||||
from fetching import fetch_page, downloadfile, announce_articleid
|
||||
from fixing import fix_html, fix_file
|
||||
|
||||
from sqlalchemy.exc import InvalidRequestError
|
||||
from compiler import article_types
|
||||
from fixing import fix_link
|
||||
# process article expects an hash with raw data for the article and puts it into an
|
||||
@@ -28,9 +28,12 @@ def process_article(art):
|
||||
aa.last_fetched = datetime.now()
|
||||
aa.sourcetype = art["sourcetype"]
|
||||
db_session.add(aa)
|
||||
db_session.commit()
|
||||
try:
|
||||
db_session.commit()
|
||||
except InvalidRequestError,e:
|
||||
db_session.rollback()
|
||||
clogger.error(e)
|
||||
clogger.info("Updated/Added Article "+ str(aa.id) + ": " + (aa.title.encode("utf-8")))
|
||||
# announce_articleid(aa.id)
|
||||
return aa
|
||||
|
||||
# process a single found url
|
||||
|
||||
Reference in New Issue
Block a user