Sfoglia il codice sorgente

Merge branch '2024-11-12-updatePublishedArticlesJob-improve' of luojunhui/LongArticlesJob into master

luojunhui 7 mesi fa
parent
commit
78488ee1da
1 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  1. 12 1
      updatePublishedMsgDaily.py

+ 12 - 1
updatePublishedMsgDaily.py

@@ -564,7 +564,7 @@ def get_article_detail_job():
                 error_msg = traceback.format_exc()
                 print(error_msg)
 
-    # 通过msgId 来修改publish_time_stamp
+    # 通过msgId 来修改publish_timestamp
     update_sql = f"""
         UPDATE official_articles_v2 oav 
         JOIN (
@@ -581,6 +581,17 @@ def get_article_detail_job():
         sql=update_sql,
         params=(0, 0)
     )
+
+    # 若还是无 publish_timestamp,用update_time当作 publish_timestamp
+    update_sql_2 = f"""
+        UPDATE official_articles_v2
+        SET publish_timestamp = update_time
+        WHERE publish_timestamp < %s;
+    """
+    db_client.update(
+        sql=update_sql_2,
+        params=0
+    )
     if fail_list:
         bot(
             title="更新文章任务,请求detail失败",