From 2400a54e3f0a993222b0fee043db6bf102f06c80 Mon Sep 17 00:00:00 2001 From: Brett Kyle Date: Thu, 19 Dec 2024 21:10:26 +0000 Subject: [PATCH] Continue RequestError --- build-filtered-data.mjs | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/build-filtered-data.mjs b/build-filtered-data.mjs index 8fbd0703..df6a1e7f 100644 --- a/build-filtered-data.mjs +++ b/build-filtered-data.mjs @@ -195,25 +195,30 @@ async function filterDeps() { console.log(`${performance.now()}: Analysis BEGIN`) for (const repo of rawDeps.all_public_dependent_repos) { - console.log(`${performance.now()}: Getting repo data...`) - const repoData = await analyseRepo(repo) - if (repoData) { - builtData.push(repoData) - batchCounter++ - } - console.log(`${performance.now()}: Analysis of ${repo.name} complete`) - - const index = rawDeps.all_public_dependent_repos.findIndex( - (item) => item === repo - ) - console.log( - `This was repo number ${index + 1} of ${ - rawDeps.all_public_dependent_repos.length - }` - ) + try { + console.log(`${performance.now()}: Getting repo data...`) + const repoData = await analyseRepo(repo) + if (repoData) { + builtData.push(repoData) + batchCounter++ + } + console.log(`${performance.now()}: Analysis of ${repo.name} complete`) + + const index = rawDeps.all_public_dependent_repos.findIndex( + (item) => item === repo + ) + console.log( + `This was repo number ${index + 1} of ${ + rawDeps.all_public_dependent_repos.length + }` + ) - const remaining = await getRemainingRateLimit() - console.log(`${remaining} remaining on rate limit`) + const remaining = await getRemainingRateLimit() + console.log(`${remaining} remaining on rate limit`) + } catch (error) { + if (error instanceof RequestError) { + continue + } } if (batchCounter >= batchSize) { await writeBatchToFiles(builtData)