|
@@ -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)
|
|
|
|