worker die

This commit is contained in:
Andreas Stephanides
2017-02-15 13:53:37 +01:00
parent 49ac42b9a5
commit eb071d9f95
2 changed files with 28 additions and 16 deletions

View File

@@ -19,14 +19,14 @@ def process_article(art):
clogger.error("Invalid article hash:" + str(art))
aa=None
else:
art["text"]=fix_html(art["text"],art["url"])
art["text"] = fix_html(art["text"], art["url"])
if "image" in art:
art["image"]=fix_file(art["url"], art["image"])
clogger.info(art)
aa = Article.from_hash(art)
aa.process_hash(art)
aa.last_fetched=datetime.now()
aa.sourcetype=art["sourcetype"]
aa.last_fetched = datetime.now()
aa.sourcetype = art["sourcetype"]
db_session.add(aa)
db_session.commit()
clogger.info("Updated/Added Article "+ str(aa.id) + ": " + (aa.title.encode("utf-8")))
@@ -82,4 +82,5 @@ def do_process(tpe, cont,params={}):
if a.has_key("url")==False:
a["url"]=cont["url"]
process_article(a)
db_session.remove()
return