Skip to content

Commit

Permalink
Skip awaiting the big check-status request
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Sep 7, 2023
1 parent f04aa67 commit a50407b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/corpora/corpora.composable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export default function useCorpora() {

// Store the pending request in module scope, so simultaneous calls will await the same promise.
if (!loadPromise) {
const loadCorporaPromise = mink
loadPromise = mink
.loadCorpora()
.catch(alertError)
.then((corpora) => corpusStore.setCorpusIds(corpora));

const loadJobsPromise = mink
// This request can take some time, so better not await it.
mink
.loadJobs()
.catch(alertError)
.then((jobs) =>
Expand All @@ -32,8 +33,6 @@ export default function useCorpora() {
corpusStore.corpora[job.corpus_id].sources = job.available_files;
})
);

loadPromise = Promise.all([loadCorporaPromise, loadJobsPromise]);
}

await loadPromise;
Expand Down

0 comments on commit a50407b

Please sign in to comment.