luojunhui преди 3 месеца
родител
ревизия
6c6de36178
променени са 1 файла, в които са добавени 1 реда и са изтрити 6 реда
  1. 1 6
      coldStartTasks/multi_modal/generate_text_from_video.py

+ 1 - 6
coldStartTasks/multi_modal/generate_text_from_video.py

@@ -59,11 +59,6 @@ class GenerateTextFromVideo(object):
     def __init__(self):
         self.google_ai_api = GoogleAIAPI()
         self.db = DatabaseConnector(db_config=long_articles_config)
-
-    def connect_db(self):
-        """
-        连接数据库
-        """
         self.db.connect()
 
     def update_task_status(self, task_id, process, ori_status, new_status):
@@ -114,7 +109,7 @@ class GenerateTextFromVideo(object):
         select_sql = f"""
             select count(1) as processing_count 
             from video_content_understanding 
-            where understanding_status = {const.PROCESSING_STATUS};
+            where file_state = 'PROCESSING' and upload_status = {const.SUCCESS_STATUS};
         """
         count = self.db.fetch(select_sql, cursor_type=DictCursor)[0]['processing_count']
         rest_video_count = max_processing_video_count - count