Pārlūkot izejas kodu

全量过滤 增加链接时间

zhangbo 1 gadu atpakaļ
vecāks
revīzija
287d3e1e7d
1 mainītis faili ar 9 papildinājumiem un 4 dzēšanām
  1. 9 4
      utils.py

+ 9 - 4
utils.py

@@ -531,13 +531,18 @@ class FilterVideos(object):
         types = config_.FILTER_VIEWED_TYPES_CONFIG.get(self.app_type, None)
         if types is None:
             types = config_.FILTER_VIEWED_TYPES_CONFIG.get('other')
+        try:
+            log_.info("cityCode:" + self.env_dict["cityCode"] if "cityCode" in self.env_dict else "-1")
+            log_.info("hotSenceType:" + str(self.env_dict and self.env_dict["hotSenceType"] if "hotSenceType" in self.env_dict else 0))
+        except Exception as e:
+            pass
         request_data = {"appType": self.app_type,
                         "mid": self.mid,
                         "uid": self.uid,
                         "types": list(types),
                         "videoIds": video_ids,
-                        "cityCode": self.env_dict["cityCode"]  if "cityCode" in self.env_dict else "-1",
-                        "hotSenceType": self.env_dict["hotSenceType"]  if "hotSenceType" in self.env_dict else 0
+                        "cityCode": self.env_dict["cityCode"] if self.env_dict and "cityCode" in self.env_dict else "-1",
+                        "hotSenceType": self.env_dict["hotSenceType"] if self.env_dict and "hotSenceType" in self.env_dict else 0
                         }
         # print(request_data)
         # 调用http接口
@@ -871,8 +876,8 @@ class FilterVideos(object):
                         "uid": self.uid,
                         "types": types,
                         "videoIds": video_ids,
-                        "cityCode": self.env_dict["cityCode"] if "cityCode" in self.env_dict else "-1",
-                        "hotSenceType": self.env_dict["hotSenceType"]  if "hotSenceType" in self.env_dict else 0
+                        "cityCode": self.env_dict["cityCode"] if self.env_dict and "cityCode" in self.env_dict else "-1",
+                        "hotSenceType": self.env_dict["hotSenceType"]  if self.env_dict and "hotSenceType" in self.env_dict else 0
                         }
         # print(request_data)
         # 调用http接口