|
@@ -111,13 +111,14 @@ def bottom_strategy(size, app_type, ab_code):
|
|
|
bottom_data = bottom_strategy_last(size=size, app_type=app_type, ab_code=ab_code)
|
|
|
return bottom_data
|
|
|
|
|
|
+ # 视频状态过滤采用离线定时过滤方案
|
|
|
# 状态过滤
|
|
|
- filter_videos = FilterVideos(app_type=app_type, video_ids=data)
|
|
|
- filtered_data = filter_videos.filter_video_status(video_ids=data)
|
|
|
- if len(filtered_data) > size:
|
|
|
- random_data = numpy.random.choice(filtered_data, size, False)
|
|
|
+ # filter_videos = FilterVideos(app_type=app_type, video_ids=data)
|
|
|
+ # filtered_data = filter_videos.filter_video_status(video_ids=data)
|
|
|
+ if len(data) > size:
|
|
|
+ random_data = numpy.random.choice(data, size, False)
|
|
|
else:
|
|
|
- random_data = filtered_data
|
|
|
+ random_data = data
|
|
|
bottom_data = [{'videoId': item, 'pushFrom': 'bottom_strategy', 'abCode': ab_code} for item in random_data]
|
|
|
return bottom_data
|
|
|
|
|
@@ -133,11 +134,12 @@ def bottom_strategy_last(size, app_type, ab_code):
|
|
|
redis_helper = RedisHelper()
|
|
|
bottom_data = redis_helper.get_data_zset_with_index(key_name=config_.BOTTOM_KEY_NAME, start=0, end=-1)
|
|
|
random_data = numpy.random.choice(bottom_data, size * 30, False)
|
|
|
+ # 视频状态过滤采用离线定时过滤方案
|
|
|
# 状态过滤
|
|
|
- filter_videos = FilterVideos(app_type=app_type, video_ids=random_data)
|
|
|
- filtered_data = filter_videos.filter_video_status(video_ids=random_data)
|
|
|
+ # 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}
|
|
|
- for video_id in filtered_data[:size]]
|
|
|
+ for video_id in random_data[:size]]
|
|
|
return bottom_data
|
|
|
|
|
|
|