Browse Source

Merge branch 'debug-bottom' into test

liqian 3 năm trước cách đây
mục cha
commit
8b3a6b960f
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 1 1
      config.py
  2. 2 2
      video_rank.py

+ 1 - 1
config.py

@@ -19,7 +19,7 @@ class BaseConfig(object):
     # 前k个从ROV召回池中获取视频
     K = 3
     # 从流量池获取视频的概率设置
-    P = 0
+    P = 0.3
 
     # ROV召回池redis key前缀,完整格式:com.weiqu.video.recall.hot.item.score.{date}
     RECALL_KEY_NAME_PREFIX = 'com.weiqu.video.recall.hot.item.score.'

+ 2 - 2
video_rank.py

@@ -119,7 +119,7 @@ def bottom_strategy(size, app_type, ab_code):
         random_data = numpy.random.choice(data, size, False)
     else:
         random_data = data
-    bottom_data = [{'videoId': item, 'pushFrom': 'bottom_strategy', 'abCode': ab_code} for item in random_data]
+    bottom_data = [{'videoId': int(item), 'pushFrom': 'bottom_strategy', 'abCode': ab_code} for item in random_data]
     return bottom_data
 
 
@@ -138,7 +138,7 @@ def bottom_strategy_last(size, app_type, ab_code):
     # 状态过滤
     # filter_videos = FilterVideos(app_type=app_type, video_ids=random_data)
     # filtered_data = filter_videos.filter_video_status(video_ids=random_data)
-    bottom_data = [{'videoId': video_id, 'pushFrom': 'bottom_strategy_last', 'abCode': ab_code}
+    bottom_data = [{'videoId': int(video_id), 'pushFrom': 'bottom_strategy_last', 'abCode': ab_code}
                    for video_id in random_data[:size]]
     return bottom_data