diff --git a/src/cache-updater/index.ts b/src/cache-updater/index.ts index fbb15981d..d0f085545 100644 --- a/src/cache-updater/index.ts +++ b/src/cache-updater/index.ts @@ -123,10 +123,17 @@ function getRepos(): RepoInfo[] { } } -const repos = getRepos(); -repos.forEach((repo) => - handler(repo).catch((error) => { - console.error('An error occurred!', error); - }) -); +async function main() { + const repos = getRepos(); + + await Promise.all(repos.map((repo) => + handler(repo).catch((error) => { + console.error('An error occurred!', error); + }) + )); + + process.exit(0); +} + +main(); \ No newline at end of file