Skip to content

Commit

Permalink
Track repos which have not been processed
Browse files Browse the repository at this point in the history
  • Loading branch information
domoscargin committed Jan 5, 2025
1 parent 3235927 commit 5c95154
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build-filtered-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const timestamp = currentDate.getTime()
async function filterDeps () {
const builtData = []
const batchSize = 500
const processedIndexes = []
let batchCounter = 0
console.log('Beginning dependency analysis...')

Expand All @@ -34,6 +35,7 @@ async function filterDeps () {
const index = rawDeps.all_public_dependent_repos.findIndex(
(item) => item === repo
)
processedIndexes.push(index)
console.log(
`This was repo number ${index + 1} of ${
rawDeps.all_public_dependent_repos.length
Expand All @@ -57,6 +59,13 @@ async function filterDeps () {
if (builtData.length > 0) {
await writeBatchToFiles(builtData)
}

const unprocessedItems = rawDeps.all_public_dependent_repos.filter((_, index) => !processedIndexes.includes(index))

await appendFileSync(
`data/${yyyymmdd}-${timestamp}-unprocessedItems.json`,
JSON.stringify(unprocessedItems, null, 2)
)
console.log("We're done!")
}

Expand Down

0 comments on commit 5c95154

Please sign in to comment.