| 
					
				 | 
			
			
				@@ -11,6 +11,7 @@ from applications.config import Config 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 from applications.log import logging 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 from applications.functions.pqFunctions import publish_to_pq, get_pq_video_detail 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 from applications.functions.common import shuffle_list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+from applications.functions.aigc import record_trace_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 class historyContentIdTask(object): 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -22,6 +23,8 @@ class historyContentIdTask(object): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     MISMATCH_STATUS = 96 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     TASK_INIT_STATUS = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     TASK_PUBLISHED_STATUS = 4 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RECORD_SUCCESS_TRACE_ID_CODE = 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RECORD_FAIL_TRACE_ID_CODE = 3 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     def __init__(self, mysql_client): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         """ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -218,6 +221,7 @@ class historyContentIdTask(object): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             trace_id=trace_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             data=L 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        await record_trace_id(trace_id=trace_id, status=self.RECORD_SUCCESS_TRACE_ID_CODE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     async def roll_back_content_status_when_fails(self, process_times, trace_id): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         """ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -334,6 +338,8 @@ class historyContentIdTask(object): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if affected_rows == 0: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     print("修改行数为 0,多个进程抢占同一个 task, 抢占失败,进程退出") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                await record_trace_id(trace_id=trace_id, status=self.RECORD_FAIL_TRACE_ID_CODE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             # 校验文章是否晋升 or 退场 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             exit_status = await self.check_title_whether_exit(content_id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if exit_status: 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -356,6 +362,9 @@ class historyContentIdTask(object): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if affected_rows == 0: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     print("修改行数为 0,多个进程抢占同一个 task, 抢占失败,进程退出") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                await record_trace_id(trace_id=trace_id, status=self.RECORD_FAIL_TRACE_ID_CODE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         gh_id = params['gh_id'] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         process_times = params['process_times'] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         download_videos = await self.get_video_list(content_id=content_id) 
			 |