Skip to content

Commit

Permalink
[DOP-4171]: Exit out of task when done
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry committed Jan 24, 2024
1 parent 6864f1f commit f2b22c4
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/cache-updater/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit f2b22c4

Please sign in to comment.