Browse Source

disable try catch

ming 3 years ago
parent
commit
b1bae3e99e
1 changed files with 6 additions and 6 deletions
  1. 6 6
      api/main.py

+ 6 - 6
api/main.py

@@ -247,15 +247,16 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar):
             print('all finish, leave loop')
             break
         top1 = first(db.query('SELECT * FROM video_queue'))
-        try:
+        #try:
+        if True:
             db.query('UPDATE video_queue_status SET status = 1;')
             c = rpyc.connect("localhost", 8878)
             c._config['sync_request_timeout'] = None
             remote_svc = c.root
             my_answer = remote_svc.call_video(top1['name_hash'],top1['name'],top1['text_content'].split(','), top1['image_urls'].split(','),top1['avatar']) # method call
-            shutil.copy(t_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
+            shutil.copy(tmp_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
             os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
-        except:
+        #except:
             print('video generation error')
             notify_group('影片錯誤')
         db['video_queue'].delete(id=top1['id'])
@@ -285,8 +286,7 @@ def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avata
             print('all finish, leave loop')
             break
         top1 = first(db.query('SELECT * FROM video_queue'))
-        #try:
-        if True:
+        try:
             db.query('UPDATE video_queue_status SET status = 1;')
             c = rpyc.connect("localhost", 8878)
             c._config['sync_request_timeout'] = None
@@ -294,7 +294,7 @@ def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avata
             my_answer = remote_svc.call_video_eng(top1['name_hash'],top1['name'],top1['text_content'].split(','), top1['image_urls'].split(','),top1['subtitles'].split(','),top1['avatar']) # method call
             shutil.copy(tmp_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
             os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
-        #except:
+        except:
             print('video generation error')
             notify_group('影片錯誤')
         db['video_queue'].delete(id=top1['id'])