|
@@ -4,6 +4,7 @@
|
|
|
|
|
|
import json
|
|
|
import time
|
|
|
+import traceback
|
|
|
from typing import List, Dict
|
|
|
|
|
|
from pymysql.cursors import DictCursor
|
|
@@ -206,11 +207,26 @@ class UpdateArticleInfoFromAIGC(object):
|
|
|
main function
|
|
|
"""
|
|
|
article_list = self.get_published_articles()
|
|
|
-
|
|
|
+ log(
|
|
|
+ task="update_article_info_from_aigc",
|
|
|
+ function="deal",
|
|
|
+ data=article_list,
|
|
|
+ message="total got {} articles this time".format(len(article_list))
|
|
|
+ )
|
|
|
for article in tqdm(article_list, desc="更新文章信息"):
|
|
|
try:
|
|
|
self.update_each_article(article)
|
|
|
except Exception as e:
|
|
|
- print(e)
|
|
|
+ log(
|
|
|
+ task="update_article_info_from_aigc",
|
|
|
+ function="update_each_article",
|
|
|
+ status="fail",
|
|
|
+ message="update_article_fail",
|
|
|
+ data={
|
|
|
+ "trace_id": article["trace_id"],
|
|
|
+ "error": str(e),
|
|
|
+ "traceback": traceback.format_exc()
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
|