From 133c0e77f2f12b39a467fcd7896ec6ac698f4cd8 Mon Sep 17 00:00:00 2001 From: taylorfries Date: Fri, 8 Nov 2024 16:06:44 -0800 Subject: [PATCH] trying different timeouts --- .github/helpers/github-api/update-issue-and-comment.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/helpers/github-api/update-issue-and-comment.mjs b/.github/helpers/github-api/update-issue-and-comment.mjs index f098217f2..3121c8513 100644 --- a/.github/helpers/github-api/update-issue-and-comment.mjs +++ b/.github/helpers/github-api/update-issue-and-comment.mjs @@ -34,6 +34,8 @@ const STATCODE = { }, }; +const timeout = (delay) => new Promise((resolve) => setTimeout(resolve, delay)); + const checkStatus = (retInfo) => { const returnedStatus = retInfo.status; @@ -110,7 +112,7 @@ const closeAndCreateIssue = async (issueTitle, issueBody) => { } // wait for issue to be created. - setTimeout(() => console.log("pausing for issue to be created..."), 1500); + timeout(1000).then(() => console.log("pausing for issue to be created...")); // return new issue number return newIssue.body.number; @@ -130,7 +132,7 @@ const createAndCloseComment = async (issueNumber, issueComment) => { } // pausing so that the comment is created, and webhook sent. - setTimeout(() => console.log("pausing for comment to be created..."), 1500); + timeout(1000).then(() => console.log("pausing for comment to be created...")); // get the comment id from the response data const commentID = newComment.data.id;