From f7d994dcb8cc9ea24f3fc311d5b603485ceb367e Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Sat, 15 Jun 2024 23:24:33 +0200 Subject: [PATCH] "Fix" on server startup script on prod --- astro.config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/astro.config.ts b/astro.config.ts index 8a7c4bf..a4fd6d8 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -20,8 +20,9 @@ export default defineConfig({ { name: "on-server-start", hooks: { - "astro:server:start": async () => { - await fetch(`http://${ASTRO_HOST}:${ASTRO_PORT}/en/api/on-startup`); + "astro:config:done": () => { + console.log("Running on startup script in 10s...") + setTimeout(() => fetch(`http://${ASTRO_HOST}:${ASTRO_PORT}/en/api/on-startup`), 10_000); }, }, },