Browse Source

add video recall

linfan 2 years ago
parent
commit
2bf39a9663
1 changed files with 12 additions and 9 deletions
  1. 12 9
      video_recall.py

+ 12 - 9
video_recall.py

@@ -2107,15 +2107,18 @@ class PoolRecall(object):
 
     #linfan
     def get_sim_hot_item_reall(self, mainVid):
-        recall_key = "sim_hot_"+mainVid
+        recall_key = "sim_hot_"+str(mainVid)
+        print("recall_key:", recall_key)
         data = self.redis_helper.get_data_from_redis(key_name=recall_key)
-        json_result =json.load(data)
-        # print(rec_json_list)
+        print(data)
         recall_result = []
-        for per_item in json_result:
-            recall_result.append(
-                {'videoId': per_item[0], 'flowPool': '',
-                 'rovScore': per_item[1], 'pushFrom': config_.PUSH_FROM['sim_hot_vid_recall'],
-                 'abCode': self.ab_code}
-            )
+        if data is not  None:
+            json_result =json.load(data)
+            print("json_result:", json_result)
+            for per_item in json_result:
+                recall_result.append(
+                    {'videoId': per_item[0], 'flowPool': '',
+                     'rovScore': per_item[1], 'pushFrom': config_.PUSH_FROM['sim_hot_vid_recall'],
+                     'abCode': self.ab_code}
+                )
         return recall_result