Skip to content

Commit

Permalink
refactor: only send slice of repos to createSnsEventsForDependencyGra…
Browse files Browse the repository at this point in the history
…phIntegration
  • Loading branch information
tjsilver committed Oct 30, 2024
1 parent a7e41bc commit d652a33
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,14 @@ export async function sendReposToDependencyGraphIntegrator(
);

if (suitableRepos.length !== 0) {
const eventsToSend: DependencyGraphIntegratorEvent[] = shuffle(
createSnsEventsForDependencyGraphIntegration(suitableRepos, repoOwners),
).slice(0, repoCount);
console.log(
`Found ${suitableRepos.length} suitable repos without dependency submission workflows`,
);

const selectedRepos = shuffle(suitableRepos).slice(0, repoCount);

const eventsToSend: DependencyGraphIntegratorEvent[] =
createSnsEventsForDependencyGraphIntegration(selectedRepos, repoOwners);

for (const event of eventsToSend) {
await sendOneRepoToDepGraphIntegrator(config, event);
Expand Down

0 comments on commit d652a33

Please sign in to comment.