Browse Source

Merge branch '2025-01-21-bugfix' of luojunhui/LongArticlesJob into master

luojunhui 3 months ago
parent
commit
646c10b65c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      updatePublishedMsgDaily.py

+ 3 - 3
updatePublishedMsgDaily.py

@@ -422,12 +422,12 @@ def get_article_detail_job(db_client: DatabaseConnector):
     update_sql = f"""
     update_sql = f"""
         UPDATE {ARTICLE_TABLE} oav 
         UPDATE {ARTICLE_TABLE} oav 
         JOIN (
         JOIN (
-            SELECT appMsgId, MAX(publish_timestamp) AS publish_timestamp 
+            SELECT ghId, appMsgId, MAX(publish_timestamp) AS publish_timestamp 
             FROM {ARTICLE_TABLE} 
             FROM {ARTICLE_TABLE} 
             WHERE publish_timestamp > %s 
             WHERE publish_timestamp > %s 
-            GROUP BY appMsgId
+            GROUP BY ghId, appMsgId
             ) vv 
             ) vv 
-            ON oav.appMsgId = vv.appMsgId
+            ON oav.appMsgId = vv.appMsgId AND oav.ghId = vv.ghId
         SET oav.publish_timestamp = vv.publish_timestamp
         SET oav.publish_timestamp = vv.publish_timestamp
         WHERE oav.publish_timestamp <= %s;
         WHERE oav.publish_timestamp <= %s;
     """
     """