瀏覽代碼

check_account_info 增加 limit 1
check_single_account 增加 limit 1

luojunhui 7 月之前
父節點
當前提交
ec3da5e73d
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      updatePublishedMsgDaily.py

+ 3 - 2
updatePublishedMsgDaily.py

@@ -244,7 +244,7 @@ def check_account_info(db_client, gh_id, account_name):
         SELECT accountName, updateTime 
         FROM {ARTICLE_TABLE}
         WHERE ghId = '{gh_id}' 
-        ORDER BY updateTime DESC;
+        ORDER BY updateTime DESC LIMIT 1;
         """
     result = db_client.select(sql)
     if result:
@@ -299,7 +299,8 @@ def check_single_account(db_client, account_item):
             FROM {ARTICLE_TABLE}
             WHERE ghId = '{gh_id}'
             ORDER BY updateTime
-            DESC;
+            DESC
+            LIMIT 1;
             """
     try:
         latest_update_time = db_client.select(sql)[0][0]