Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed May 21, 2024
1 parent 367e2cb commit 3c370dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/scripts/backfill-answer-resolution-times.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ if (require.main === module) {
resolverId: row.resolver_id ? (row.resolver_id as string) : undefined,
})
)

const toUpdate = resolvedAnswers.length
let total = 0
for (const answer of resolvedAnswers) {
console.log('update answer', answer.id)
await firestore
.doc(`contracts/${answer.contractId}/answersCpmm/${answer.id}`)
.update(
Expand All @@ -29,6 +29,8 @@ if (require.main === module) {
resolverId: answer.resolverId,
})
)
total++
console.log(`Updated ${total}/${toUpdate} answers`)
}
})
}

0 comments on commit 3c370dd

Please sign in to comment.