Skip to content

Commit 3673cf8

Browse files
committed
Parallelizes a bit more of launchpad fetching
1 parent e5d774b commit 3673cf8

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/plus/launchpad/launchpadProvider.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -624,26 +624,19 @@ export class LaunchpadProvider implements Disposable {
624624
staleDate.setDate(staleDate.getDate() - staleThreshold);
625625
}
626626

627-
const enrichedItemsPromise = this.getEnrichedItems({ force: options?.force, cancellation: cancellation });
628-
629-
if (this.container.git.isDiscoveringRepositories) {
630-
await this.container.git.isDiscoveringRepositories;
631-
}
632-
633-
if (cancellation?.isCancellationRequested) throw new CancellationError();
634-
635-
const [enrichedItemsResult, prsWithCountsResult] = await Promise.allSettled([
636-
enrichedItemsPromise,
637-
this.getPullRequestsWithSuggestionCounts({ force: options?.force, cancellation: cancellation }),
638-
]);
639-
640-
if (cancellation?.isCancellationRequested) throw new CancellationError();
641-
642627
// TODO: Since this is all repos we probably should order by repos you are a contributor on (or even filter out one you aren't)
643628

644629
let result: LaunchpadCategorizedResult | undefined;
645630

646631
try {
632+
const [_, enrichedItemsResult, prsWithCountsResult] = await Promise.allSettled([
633+
this.container.git.isDiscoveringRepositories,
634+
this.getEnrichedItems({ force: options?.force, cancellation: cancellation }),
635+
this.getPullRequestsWithSuggestionCounts({ force: options?.force, cancellation: cancellation }),
636+
]);
637+
638+
if (cancellation?.isCancellationRequested) throw new CancellationError();
639+
647640
if (prsWithCountsResult.status === 'rejected') {
648641
Logger.error(prsWithCountsResult.reason, scope, 'Failed to get pull requests with suggestion counts');
649642
result = {

0 commit comments

Comments
 (0)