tomoya 1 mesiac pred
rodič
commit
1fa1a0f05e

+ 13 - 2
backend/app/app/api/api_v1/endpoints/text2zip.py

@@ -217,10 +217,21 @@ async def wait_finish(model, email, texts, lang):
     zip_filename = video_data['stored_filename']+".zip"
     process = await asyncio.create_subprocess_exec("sshpass", "-p", "choozmo9", 
                     "scp", "-P", "5722", "-o", "StrictHostKeyChecking=no", f"/tmp/{zip_filename}", f"root@172.104.93.163:{str(LOCAL_ZIP_STORAGE)}")
+    
+    await process.wait()
     if os.path.exists(f"/tmp/{zip_filename}"):
         os.remove(f"/tmp/{zip_filename}")
-    await process.wait()
-
+    headers = {
+        'Authorization': 'Bearer ' + LINE_TOKEN    
+    }
+    data = {
+        'message':f'cloud-choozmo-com\n \
+                    Video\n \
+                    user: {current_user.id}\n \
+                    video: {video_data["id"]}\n \
+                    state: queuing'     
+    }
+    data = requests.post(LINE_URL, headers=headers, data=data) 
     task = celery_app.send_task("app.worker.make_video", kwargs=video_data)
     while True:
        await asyncio.sleep(1)