Skip to content

Commit

Permalink
perf: parallel DAG size calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed Aug 12, 2021
1 parent 2861e33 commit 2f80af9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cron/src/jobs/pins.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const FIND_PENDING_PINS = gql`
peerId
}
status
created
}
after
}
Expand Down Expand Up @@ -112,7 +113,7 @@ export async function updatePinStatuses ({ cluster, db, ipfs }) {
}))
log('✅ Done')

for (const pin of checkDagSizePins) {
await Promise.all(checkDagSizePins.map(async pin => {
log(`⏳ ${pin.content.cid}: Querying DAG size...`)
let dagSize
try {
Expand All @@ -124,7 +125,7 @@ export async function updatePinStatuses ({ cluster, db, ipfs }) {
log(`💥 ${pin.content.cid}@${pin.location.peerId}: Failed to update DAG size`)
log(err)
}
}
}))

after = queryRes.findPinsByStatus.after
if (!after) break
Expand Down

0 comments on commit 2f80af9

Please sign in to comment.