Quellcode durchsuchen

Merge branch 'debug-bottom' into pre-master

liqian vor 3 Jahren
Ursprung
Commit
89f8d802c3
2 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen
  1. 2 2
      video_rank.py
  2. 7 4
      video_recall.py

+ 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
 

+ 7 - 4
video_recall.py

@@ -40,7 +40,7 @@ class PoolRecall(object):
             top_video_ids, top_video_result = [], []
         else:
             top_video_ids, top_video_result = self.get_top_videos()
-            log_.info('top video result = {}'.format(top_video_ids))
+            log_.info('===top video result = {}'.format(top_video_ids))
 
         # 获取修改过rov的视频
         update_rov_video_ids, update_rov_result = self.get_update_rov_videos()
@@ -388,13 +388,16 @@ class PoolRecall(object):
             video_ids = []
             video_info = {}
             for item in eval(data):
-                # log_.info('=== item === {}'.format(item))
+                # log_.info('=== uid: {},  item === {}'.format(self.uid, item))
                 video_id = int(item['videoId'])
                 # 判断 视频推荐区域与用户地址信息 是否匹配,市级别
                 city_code_list = item['cityCode'].split(',')
+                # log_.info('=== uid: {},  city_code_list: {},{}, cityCode: {},{} === '.format(
+                #     self.uid, city_code_list, type(city_code_list[0]), self.client_info.get('cityCode'),
+                #     type(self.client_info.get('cityCode'))))
                 if self.client_info.get('cityCode') in city_code_list or config_.ALL_AREA_CODE in city_code_list:
-                    # log_.info('===2=== {}, ===3=== video_id: {}, cityCode: {}'.format(
-                    #     self.client_info.get('cityCode'), video_id, city_code_list))
+                    # log_.info('=== uid: {}, ===2=== {}, ===3=== video_id: {}, cityCode: {}'.format(
+                    #     self.uid, self.client_info.get('cityCode'), video_id, city_code_list))
                     if video_id in video_ids and item['score'] > video_info[video_id].get('score'):
                         # 如果video_id有重复,score保留大分值
                         video_info[video_id] = {'score': item['score'], 'cityCode': city_code_list}