Parcourir la source

暂时优化new_content_id_task

luojunhui il y a 4 mois
Parent
commit
67b2f1a583
1 fichiers modifiés avec 16 ajouts et 1 suppressions
  1. 16 1
      server/api/get_off_videos.py

+ 16 - 1
server/api/get_off_videos.py

@@ -117,6 +117,15 @@ class GetOffVideos(object):
         else:
         else:
             return False
             return False
 
 
+    async def check_trace_id_startswith(self):
+        """
+        trace_id是否以search开头
+        """
+        if self.trace_id.startswith('search'):
+            return True
+        else:
+            return False
+
     async def deal(self):
     async def deal(self):
         """
         """
         :return:
         :return:
@@ -125,6 +134,13 @@ class GetOffVideos(object):
         if params_error:
         if params_error:
             return params_error
             return params_error
         else:
         else:
+            trace_id_process_flag = await self.check_trace_id_startswith()
+            if not trace_id_process_flag:
+                return {
+                    "traceId": self.trace_id,
+                    "msg": "do not process trace id"
+                }
+
             trace_id_exist_flag = await self.check_trace_id()
             trace_id_exist_flag = await self.check_trace_id()
             if trace_id_exist_flag:
             if trace_id_exist_flag:
                 return await self.push_video_into_queue()
                 return await self.push_video_into_queue()
@@ -137,4 +153,3 @@ class GetOffVideos(object):
                     api="get_off_videos"
                     api="get_off_videos"
                 )
                 )
                 return response
                 return response
-