"Fix" on server startup script on prod

This commit is contained in:
DrMint 2024-06-15 23:24:33 +02:00
parent 9105b04032
commit f7d994dcb8
1 changed files with 3 additions and 2 deletions

View File

@ -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);
},
},
},