ming 3 anos atrás
pai
commit
cfa7175785
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      api/main.py

+ 5 - 1
api/main.py

@@ -1083,8 +1083,12 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar,multiLang,vid
         if first(db.query('SELECT COUNT(1) FROM video_queue where video_type="short"'))['COUNT(1)'] == 0:
             print('all finish, leave loop')
             break
-        top1 = first(db.query('SELECT * FROM video_queue where video_type="short"'))
         try:
+            db.close()
+            db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
+            top1 = first(db.query('SELECT * FROM video_queue where video_type="short"'))
+            print(top1)
+            print(top1['name_hash'])
         # if True:
             db.query('UPDATE video_queue_status SET status = 1;')
             c = rpyc.connect("localhost", 8858)