From a76aba62f23c410ca73e00df1d659d69ee201465 Mon Sep 17 00:00:00 2001 From: Aditya Thakral Date: Wed, 9 Jun 2021 07:14:11 -0400 Subject: [PATCH] Add a 10 second wait to give gitlab time to update the link --- index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index df59b2a..d793740 100644 --- a/index.ts +++ b/index.ts @@ -14,7 +14,7 @@ const base64 = Buffer.from( app.use(Express.static(__dirname + "/out")); -app.post("/", (req, res) => { +app.post("/", async (req, res) => { const header = req.header("authorization"); if (header == null) { @@ -39,6 +39,7 @@ app.post("/", (req, res) => { return; } + await sleep(10); updateWebsite(); res.send("Done!"); @@ -58,3 +59,7 @@ function updateWebsite() { execSync(`wget -O ${zipPath} '${url}'`); execSync(`yes All | unzip ${zipPath}`); } + +function sleep(seconds: number) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +}