From c5f300514b7980ceaaef80c91ff283eca6a1476a Mon Sep 17 00:00:00 2001 From: Markus Keil Date: Thu, 21 Mar 2024 10:40:41 +0100 Subject: [PATCH] add delay --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ddd0bea..184a022 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,7 @@ const {default: PQueue} = require('p-queue'); const yaml = require('js-yaml'); const fs = require('fs'); - +const delay = ms => new Promise(res => setTimeout(res, ms)); async function getGithubRepositories(username, token, mirrorPrivateRepositories, isOrg) { const octokit = new Octokit({ auth: token || null, @@ -195,6 +195,9 @@ async function yamlOrg() { const githubRepositories = await getGithubRepositories(org, githubToken, false, true); console.log(`\tFound ${githubRepositories.length} repositories on github`); repos.push(...githubRepositories) + console.log("waiting 60sec...") + await delay(60000); + }