worker die
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user