luojunhui il y a 1 mois
Parent
commit
4c0f0dadf9
1 fichiers modifiés avec 15 ajouts et 5 suppressions
  1. 15 5
      coldStartTasks/multi_modal/generate_text_from_video.py

+ 15 - 5
coldStartTasks/multi_modal/generate_text_from_video.py

@@ -281,12 +281,22 @@ class GenerateTextFromVideo(object):
                         tqdm.write("video is still processing")
 
                     case 'FAILED':
-                        self.update_task_status(
-                            task_id=task['id'],
-                            process='understanding',
-                            ori_status=const.PROCESSING_STATUS,
-                            new_status=const.FAIL_STATUS
+                        update_sql = f"""
+                            update video_content_understanding
+                            set file_state = %s, understanding_status = %s, understanding_status_ts = %s
+                            where id = %s and understanding_status = %s;
+                        """
+                        self.db.save(
+                            query=update_sql,
+                            params=(
+                                state,
+                                const.FAIL_STATUS,
+                                datetime.datetime.now(),
+                                task['id'],
+                                const.PROCESSING_STATUS
+                            )
                         )
+                        # delete local file and google file
                         if os.path.exists(video_local_path):
                             os.remove(video_local_path)