zhangyong 6 months ago
parent
commit
129a45d9a6
1 changed files with 17 additions and 17 deletions
  1. 17 17
      job_redis_data.py

+ 17 - 17
job_redis_data.py

@@ -1,4 +1,5 @@
 import datetime
+import time
 
 import schedule
 
@@ -7,7 +8,7 @@ from common.redis import install_video_data
 def bot_video_ai_top():
     """头部"""
     dt = datetime.datetime.now().strftime('%Y%m%d')
-    dt = '20241014'
+    # dt = '20241014'
     redis_task = 'task:video_ai'
     table_name = 'content_ai_tag_return_top'
     install_video_data(dt, redis_task, table_name)
@@ -17,7 +18,7 @@ def bot_video_ai_top():
 def bot_video_ai_recommend():
     """新推荐"""
     dt = datetime.datetime.now().strftime('%Y%m%d%H')
-    dt = '2024101514'
+    # dt = '2024101514'
     redis_task = 'task:video_ai'
     table_name = 'content_ai_tag_recommend'
     install_video_data(dt, redis_task, table_name)
@@ -26,26 +27,25 @@ def bot_video_ai_recommend():
 def bot_video_ai_complex_mode():
     """复推"""
     dt = datetime.datetime.now().strftime('%Y%m%d%H')
-    dt = '2024101514'
+    # dt = '2024101514'
     redis_task = 'task:video_ai'
     table_name = 'content_ai_tag_reflowpool'
     install_video_data(dt, redis_task, table_name)
 
 
-# def schedule_tasks():
-#     # 每小时第1分钟执行
-#     schedule.every().hour.at(":01").do(video_ai_complex_mode)
-#     schedule.every().hour.at(":01").do(bot_video_ai_recommend)
-#
-#     # 每天 00:10 执行
-#     schedule.every().day.at("00:10").do(bot_video_ai_top)
+def schedule_tasks():
+    schedule.every().hour.at(":20").do(bot_video_ai_complex_mode)
+    schedule.every().hour.at(":22").do(bot_video_ai_recommend)
+
+    # 每天 00:10 执行
+    schedule.every().day.at("01:25").do(bot_video_ai_top)
 
 
 if __name__ == "__main__":
-    # schedule_tasks()  # 调用任务调度函数
-    # while True:
-    #     schedule.run_pending()
-    #     time.sleep( 1 )  # 每秒钟检查一次
-    bot_video_ai_top()
-    bot_video_ai_recommend()
-    bot_video_ai_complex_mode()
+    schedule_tasks()  # 调用任务调度函数
+    while True:
+        schedule.run_pending()
+        time.sleep(1)  # 每秒钟检查一次
+    # bot_video_ai_top()
+    # bot_video_ai_recommend()
+    # bot_video_ai_complex_mode()