Explorar el Código

修改 pipeline

罗俊辉 hace 1 año
padre
commit
92124d06fc
Se han modificado 1 ficheros con 35 adiciones y 18 borrados
  1. 35 18
      common/pipeline.py

+ 35 - 18
common/pipeline.py

@@ -18,24 +18,41 @@ class PiaoQuanPipeline:
         # 判断发布时间
         publish_time_stamp = self.item["publish_time_stamp"]
         update_time_stamp = self.item["update_time_stamp"]
-        if (
-            int(time.time()) - publish_time_stamp
-            > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
-        ) and (
-            int(time.time()) - update_time_stamp
-            > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
-        ):
-            AliyunLogger.logging(
-                code="2004",
-                trace_id=self.trace_id,
-                platform=self.platform,
-                mode=self.mode,
-                env=self.env,
-                message="发布时间超过{}天".format(
-                    int(self.rule_dict.get("period", {}).get("max", 1000))
-                ),
-            )
-            return False
+        if self.platform == "gongzhonghao":
+            if (
+                int(time.time()) - publish_time_stamp
+                > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
+            ) and (
+                int(time.time()) - update_time_stamp
+                > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
+            ):
+                AliyunLogger.logging(
+                    code="2004",
+                    trace_id=self.trace_id,
+                    platform=self.platform,
+                    mode=self.mode,
+                    env=self.env,
+                    message="发布时间超过{}天".format(
+                        int(self.rule_dict.get("period", {}).get("max", 1000))
+                    ),
+                )
+                return False
+        else:
+            if (
+                int(time.time()) - publish_time_stamp
+                > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
+            ):
+                AliyunLogger.logging(
+                    code="2004",
+                    trace_id=self.trace_id,
+                    platform=self.platform,
+                    mode=self.mode,
+                    env=self.env,
+                    message="发布时间超过{}天".format(
+                        int(self.rule_dict.get("period", {}).get("max", 1000))
+                    ),
+                )
+                return False
         return True
 
     # 视频标题是否满足需求