|
@@ -28,7 +28,7 @@ class DailyDataManager(object):
|
|
|
"""
|
|
|
today = datetime.today()
|
|
|
# 获取昨天的日期
|
|
|
- yesterday = today - timedelta(days=1)
|
|
|
+ yesterday = today - timedelta(days=10)
|
|
|
yesterday_midnight = datetime(year=yesterday.year, month=yesterday.month, day=yesterday.day)
|
|
|
yesterday_timestamp = yesterday_midnight.timestamp()
|
|
|
sql2 = f"""
|
|
@@ -36,8 +36,11 @@ class DailyDataManager(object):
|
|
|
from official_articles_v2
|
|
|
where createTime >= {yesterday_timestamp}
|
|
|
and accountName in (
|
|
|
- select distinct account_name from account_avg_info_v2
|
|
|
- );
|
|
|
+ '晚年家人', '史趣探秘', '暖心一隅', '小阳看天下', '小惠爱厨房'
|
|
|
+ );
|
|
|
+-- and accountName in (
|
|
|
+-- select distinct account_name from account_avg_info_v2
|
|
|
+-- );
|
|
|
"""
|
|
|
result_list = cls.pqMysql.select(sql2)
|
|
|
log(
|
|
@@ -233,7 +236,7 @@ class DailyDataManager(object):
|
|
|
"""
|
|
|
today = datetime.today()
|
|
|
# 获取三天前的日期
|
|
|
- yesterday = today - timedelta(days=3)
|
|
|
+ yesterday = today - timedelta(days=10)
|
|
|
yesterday_str = yesterday.__str__().split(" ")[0]
|
|
|
sql = f"""
|
|
|
select distinct root_source_id
|
|
@@ -325,15 +328,20 @@ def updateMinigramInfoJob():
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
- schedule.every().day.at("01:00").do(Functions().job_with_thread, updateArticlesJob)
|
|
|
-
|
|
|
- schedule.every().day.at("03:30").do(Functions().job_with_thread, updateMinigramInfoJob)
|
|
|
-
|
|
|
- while True:
|
|
|
- schedule.run_pending()
|
|
|
- time.sleep(60)
|
|
|
- log(
|
|
|
- task="updateMinigramInfoDaily",
|
|
|
- function="main",
|
|
|
- message="更新文章小程序信息任务正常执行"
|
|
|
- )
|
|
|
+ # DD = DailyDataManager()
|
|
|
+ # articleList = DD.getPublishedArticles()
|
|
|
+ # print(len(articleList))
|
|
|
+ # updateArticlesJob()
|
|
|
+ updateMinigramInfoJob()
|
|
|
+ # schedule.every().day.at("01:00").do(Functions().job_with_thread, updateArticlesJob)
|
|
|
+ #
|
|
|
+ # schedule.every().day.at("03:30").do(Functions().job_with_thread, updateMinigramInfoJob)
|
|
|
+ #
|
|
|
+ # while True:
|
|
|
+ # schedule.run_pending()
|
|
|
+ # time.sleep(60)
|
|
|
+ # log(
|
|
|
+ # task="updateMinigramInfoDaily",
|
|
|
+ # function="main",
|
|
|
+ # message="更新文章小程序信息任务正常执行"
|
|
|
+ # )
|