remove that too
Browse files- App/Worker.py +9 -11
App/Worker.py
CHANGED
|
@@ -189,20 +189,18 @@ async def cleanup_temp_directory(
|
|
| 189 |
chat_id: int = -1002069945904,
|
| 190 |
):
|
| 191 |
video_folder_dir = f"/tmp/Video/{video_task.constants.task}"
|
| 192 |
-
|
| 193 |
try:
|
| 194 |
print("sending...")
|
| 195 |
# bot.send_video(chat_id=chat_id,caption="Your Video Caption",file_name=output_dir)
|
| 196 |
await bot.send_file(chat_id, file=output_dir, caption="Your video caption")
|
| 197 |
|
| 198 |
-
|
| 199 |
-
|
| 200 |
finally:
|
| 201 |
-
#remotion_app_dir = os.path.join("/srv", "Remotion-app")
|
| 202 |
-
#shutil.rmtree(remotion_app_dir)
|
| 203 |
# use the cache
|
| 204 |
-
#shutil.copytree(temp_dir, remotion_app_dir)
|
| 205 |
-
#if not SERVER_STATE.CACHED:
|
| 206 |
# SERVER_STATE.CACHED = True
|
| 207 |
# Cleanup: Remove the temporary directory
|
| 208 |
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
@@ -218,15 +216,15 @@ async def celery_task(video_task: EditorRequest):
|
|
| 218 |
|
| 219 |
copy_remotion_app(remotion_app_dir, temp_dir)
|
| 220 |
|
| 221 |
-
# use the cached stuff
|
| 222 |
-
if not SERVER_STATE.CACHED:
|
| 223 |
-
|
| 224 |
|
| 225 |
create_constants_json_file(video_task.constants, assets_dir)
|
| 226 |
create_json_file(video_task.assets, assets_dir)
|
| 227 |
download_assets(video_task.links, temp_dir)
|
| 228 |
render_video(temp_dir, output_dir)
|
| 229 |
-
#unsilence(temp_dir)
|
| 230 |
await cleanup_temp_directory(temp_dir, output_dir, video_task)
|
| 231 |
|
| 232 |
# chain(
|
|
|
|
| 189 |
chat_id: int = -1002069945904,
|
| 190 |
):
|
| 191 |
video_folder_dir = f"/tmp/Video/{video_task.constants.task}"
|
| 192 |
+
|
| 193 |
try:
|
| 194 |
print("sending...")
|
| 195 |
# bot.send_video(chat_id=chat_id,caption="Your Video Caption",file_name=output_dir)
|
| 196 |
await bot.send_file(chat_id, file=output_dir, caption="Your video caption")
|
| 197 |
|
|
|
|
|
|
|
| 198 |
finally:
|
| 199 |
+
# remotion_app_dir = os.path.join("/srv", "Remotion-app")
|
| 200 |
+
# shutil.rmtree(remotion_app_dir)
|
| 201 |
# use the cache
|
| 202 |
+
# shutil.copytree(temp_dir, remotion_app_dir)
|
| 203 |
+
# if not SERVER_STATE.CACHED:
|
| 204 |
# SERVER_STATE.CACHED = True
|
| 205 |
# Cleanup: Remove the temporary directory
|
| 206 |
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
|
|
| 216 |
|
| 217 |
copy_remotion_app(remotion_app_dir, temp_dir)
|
| 218 |
|
| 219 |
+
# # use the cached stuff
|
| 220 |
+
# if not SERVER_STATE.CACHED:
|
| 221 |
+
# install_dependencies(temp_dir)
|
| 222 |
|
| 223 |
create_constants_json_file(video_task.constants, assets_dir)
|
| 224 |
create_json_file(video_task.assets, assets_dir)
|
| 225 |
download_assets(video_task.links, temp_dir)
|
| 226 |
render_video(temp_dir, output_dir)
|
| 227 |
+
# unsilence(temp_dir)
|
| 228 |
await cleanup_temp_directory(temp_dir, output_dir, video_task)
|
| 229 |
|
| 230 |
# chain(
|