Skip to content

Commit

Permalink
Continue RequestError
Browse files Browse the repository at this point in the history
  • Loading branch information
domoscargin committed Dec 19, 2024
1 parent 0ca0a4c commit 2400a54
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions build-filtered-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2400a54

Please sign in to comment.