Fix rebuild: clear Astro cache and use --force; update site submodule

This commit is contained in:
brutsalvadi
2026-05-07 12:15:27 +02:00
parent 098093fb97
commit 75b8f16375
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -307,8 +307,13 @@ async def upload_asset(file: UploadFile = File(...), user: User = Depends(requir
@app.post("/rebuild") @app.post("/rebuild")
async def rebuild(user: User = Depends(require_auth)) -> JSONResponse: async def rebuild(user: User = Depends(require_auth)) -> JSONResponse:
try: try:
# Clear Astro content cache so changed files outside site/ are re-read.
try:
(site_dir / ".astro" / "data-store.json").unlink(missing_ok=True)
except Exception:
pass
proc = await asyncio.create_subprocess_exec( proc = await asyncio.create_subprocess_exec(
"npm", "run", "build", "npm", "run", "build", "--", "--force",
cwd=site_dir, cwd=site_dir,
stdout=asyncio.subprocess.PIPE, stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,
+1 -1
Submodule site updated: 6d7c02e312...4af3660653