liqian 2 years ago
parent
commit
5583f9e8d3
2 changed files with 4 additions and 3 deletions
  1. 1 1
      recommend.py
  2. 3 2
      video_rank.py

+ 1 - 1
recommend.py

@@ -266,7 +266,7 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al
         # 兜底策略
         # log_.info('====== bottom strategy')
         start_bottom = time.time()
-        rank_result = bottom_strategy(size=size, app_type=app_type, ab_code=ab_code)
+        rank_result = bottom_strategy(request_id=request_id, size=size, app_type=app_type, ab_code=ab_code)
         end_bottom = time.time()
         log_.info({'request_id': request_id,
                    'mid': mid,

+ 3 - 2
video_rank.py

@@ -152,15 +152,16 @@ def remove_duplicate(rov_recall, flow_recall, top_K):
     return rov_recall, flow_recall_result
 
 
-def bottom_strategy(size, app_type, ab_code):
+def bottom_strategy(request_id, size, app_type, ab_code):
     """
     兜底策略: 从ROV召回池中获取top1000,进行状态过滤后的视频
+    :param request_id: request_id
     :param size: 需要获取的视频数
     :param app_type: 产品标识 type-int
     :param ab_code: abCode
     :return:
     """
-    pool_recall = PoolRecall(app_type=app_type, ab_code=ab_code)
+    pool_recall = PoolRecall(request_id=request_id, app_type=app_type, ab_code=ab_code)
     key_name, _ = pool_recall.get_pool_redis_key(pool_type='rov')
     redis_helper = RedisHelper()
     data = redis_helper.get_data_zset_with_index(key_name=key_name, start=0, end=1000)