|
@@ -22,7 +22,7 @@ from applications.const import updatePublishedMsgTaskConst
|
|
|
from applications.db import DatabaseConnector
|
|
|
from config import denet_config, long_articles_config, piaoquan_crawler_config
|
|
|
|
|
|
-ARTICLE_TABLE = "official_articles_v2"
|
|
|
+ARTICLE_TABLE = "official_articles"
|
|
|
const = updatePublishedMsgTaskConst()
|
|
|
spider = WeixinSpider()
|
|
|
functions = Functions()
|
|
@@ -258,12 +258,12 @@ class UpdatePublishedArticlesReadDetail(object):
|
|
|
account_info=account_info,
|
|
|
msg_list=msg_list
|
|
|
)
|
|
|
- if last_time_stamp_in_this_msg > latest_update_time:
|
|
|
- next_cursor = response['data']['next_cursor']
|
|
|
- return self.update_account_by_spider(
|
|
|
- account_info=account_info,
|
|
|
- cursor=next_cursor
|
|
|
- )
|
|
|
+ # if last_time_stamp_in_this_msg > latest_update_time:
|
|
|
+ # next_cursor = response['data']['next_cursor']
|
|
|
+ # return self.update_account_by_spider(
|
|
|
+ # account_info=account_info,
|
|
|
+ # cursor=next_cursor
|
|
|
+ # )
|
|
|
log(
|
|
|
task="updatePublishedMsgDaily",
|
|
|
function="update_each_account",
|
|
@@ -628,12 +628,12 @@ class UpdatePublishedArticlesReadDetail(object):
|
|
|
update_sql = f"""
|
|
|
UPDATE {ARTICLE_TABLE} oav
|
|
|
JOIN (
|
|
|
- SELECT appMsgId, MAX(publish_timestamp) AS publish_timestamp
|
|
|
+ SELECT ghId, appMsgId, MAX(publish_timestamp) AS publish_timestamp
|
|
|
FROM {ARTICLE_TABLE}
|
|
|
WHERE publish_timestamp > %s
|
|
|
- GROUP BY appMsgId
|
|
|
- ) vv
|
|
|
- ON oav.appMsgId = vv.appMsgId
|
|
|
+ GROUP BY ghId, appMsgId
|
|
|
+ ) vv
|
|
|
+ ON oav.appMsgId = vv.appMsgId and oav.ghId = vv.ghId
|
|
|
SET oav.publish_timestamp = vv.publish_timestamp
|
|
|
WHERE oav.publish_timestamp <= %s;
|
|
|
"""
|