From 418220feb262d4f8358ee5f475b5eca6e95ef645 Mon Sep 17 00:00:00 2001 From: bonamin Date: Fri, 27 Feb 2026 05:47:57 +0200 Subject: [PATCH] fix: trying to fix auto-pulls 15 ! --- backend/admin/router.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/admin/router.py b/backend/admin/router.py index 450c30a..6af0cf6 100644 --- a/backend/admin/router.py +++ b/backend/admin/router.py @@ -44,15 +44,17 @@ async def deploy(request: Request): project_path = settings.deploy_project_path cmd = ( + f"sleep 3 && " f"git config --global --add safe.directory {project_path} && " f"cd {project_path} && " f"git fetch origin main && " f"git reset --hard origin/main && " f"docker-compose up -d --build" + f" > /proc/1/fd/1 2>&1" ) - # Fire and forget — run deploy in background so we can respond before - # the container restarts (which would kill this very process). + # Fire and forget — sleep gives uvicorn time to flush the HTTP response + # before docker-compose tears down and restarts this container. await asyncio.create_subprocess_shell( cmd, stdout=asyncio.subprocess.DEVNULL, @@ -60,5 +62,5 @@ async def deploy(request: Request): start_new_session=True, ) - logger.info("Auto-deploy started in background") + logger.info("Auto-deploy queued (starts in 3s)") return {"ok": True, "message": "Deploy started"}