liqian 3 anos atrás
pai
commit
81a4febd70
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      rule_rank_h.py

+ 4 - 4
rule_rank_h.py

@@ -111,13 +111,13 @@ def video_rank(df, now_date, now_h):
     # 获取符合进入召回源条件的视频,进入条件:小时级回流>=20 && score>=0.005
     h_recall_df = df[(df['lastonehour_return'] >= 20) & (df['score'] >= 0.005)]
     h_recall_videos = h_recall_df['videoid'].to_list()
-    print(len(h_recall_videos))
+    log_.info(f'h_recall videos count = {len(h_recall_videos)}')
 
     # 去重合并
     final_videos = [int(item) for item in h_recall_videos]
     temp_videos = [int(video_id) for video_id, _ in initial_data if int(video_id) not in final_videos]
     final_videos = final_videos + temp_videos
-    print(len(final_videos))
+    log_.info(f'final videos count = {len(final_videos)}')
 
     # 重新给定score
     final_data = {}
@@ -158,7 +158,7 @@ def h_rank_bottom(now_date, now_h):
 
 def h_timer_check():
     now_date = datetime.datetime.today()
-    log_.info(f"now_date: {datetime.datetime.strftime(now_date, '%Y%m%d')}")
+    log_.info(f"now_date: {datetime.datetime.strftime(now_date, '%Y%m%d%h')}")
     now_h = datetime.datetime.now().hour
     now_min = datetime.datetime.now().minute
     # 查看当前小时更新的数据是否已准备好
@@ -167,7 +167,7 @@ def h_timer_check():
         # 数据准备好,进行更新
         rank_by_h(now_date=now_date, now_h=now_h)
     elif now_min > 50:
-        log_.info('op data is None, use bottom data!')
+        log_.info('h_recall data is None, use bottom data!')
         h_rank_bottom(now_date=now_date, now_h=now_h)
     else:
         # 数据没准备好,1分钟后重新检查