liqian 1 年之前
父节点
当前提交
4db6a23170
共有 1 个文件被更改,包括 10 次插入9 次删除
  1. 10 9
      video_recall.py

+ 10 - 9
video_recall.py

@@ -1068,15 +1068,16 @@ class PoolRecall(object):
             # add_flow_pool_recall_log
             flow_pool_recall_process['filtered_data'] = filtered_result
 
-            for item in filtered_result:
-                video_id = int(item)
-                # 添加视频源参数 pushFrom, abCode
-                flow_pool_recall_result.append(
-                    {'videoId': video_id, 'flowPool': check_result_mapping[video_id][0], 'level': level,
-                     'rovScore': check_result_mapping[video_id][1],
-                     'pushFrom': config_.PUSH_FROM['flow_recall'],
-                     'abCode': self.ab_code, 'flow_pool_abtest_group': flow_pool_abtest_group}
-                )
+            if filtered_result:
+                for item in filtered_result:
+                    video_id = int(item)
+                    # 添加视频源参数 pushFrom, abCode
+                    flow_pool_recall_result.append(
+                        {'videoId': video_id, 'flowPool': check_result_mapping[video_id][0], 'level': level,
+                         'rovScore': check_result_mapping[video_id][1],
+                         'pushFrom': config_.PUSH_FROM['flow_recall'],
+                         'abCode': self.ab_code, 'flow_pool_abtest_group': flow_pool_abtest_group}
+                    )
 
         return flow_pool_recall_result[:size], flow_pool_recall_process