Add a 10 second wait to give gitlab time to update the link

This commit is contained in:
Aditya Thakral 2021-06-09 07:14:11 -04:00
parent df877107a3
commit a76aba62f2
1 changed files with 6 additions and 1 deletions

View File

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