Skip to content

Commit

Permalink
trying different timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorFries committed Nov 9, 2024
1 parent d38582e commit 133c0e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/helpers/github-api/update-issue-and-comment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const STATCODE = {
},
};

const timeout = (delay) => new Promise((resolve) => setTimeout(resolve, delay));

const checkStatus = (retInfo) => {
const returnedStatus = retInfo.status;

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 133c0e7

Please sign in to comment.