Skip to content

Commit e8811ac

Browse files
committed
delete flush fix
1 parent 499795d commit e8811ac

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

infra/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ curl -X POST http://localhost:8080/ \
103103
"job": {
104104
"jobConfiguration": {
105105
"query": {
106-
"query": "/* {\"dataform_trigger\": \"report_cwv_tech_complete\", \"date\": \"2024-10-01\", \"name\": \"adoption\", \"type\": \"report\"} *\/"
106+
"query": "/* {\"dataform_trigger\": \"report_cwv_tech_complete\", \"date\": \"2024-11-01\", \"name\": \"adoption\", \"type\": \"report\"} *\/"
107107
}
108108
}
109109
}

infra/dataform-export/firestore.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export class FirestoreBatch {
9090

9191
snapshot.forEach(async (doc) => {
9292
this.currentBatch.push(doc)
93-
totalDocsDeleted++
9493

9594
if (this.currentBatch.length >= this.batchSize) {
9695
this.queueBatch('delete')
@@ -99,12 +98,13 @@ export class FirestoreBatch {
9998
if (this.batchPromises.length >= this.maxConcurrentBatches) {
10099
await this.commitBatches()
101100
}
101+
totalDocsDeleted++
102102
})
103-
await this.finalFlush('delete')
104-
105-
const duration = (Date.now() - startTime) / 1000
106-
console.info(`Deletion complete. Total docs deleted: ${totalDocsDeleted}. Time: ${duration} seconds`)
107103
}
104+
await this.finalFlush('delete')
105+
106+
const duration = (Date.now() - startTime) / 1000
107+
console.info(`Deletion complete. Total docs deleted: ${totalDocsDeleted}. Time: ${duration} seconds`)
108108
}
109109

110110
/**

0 commit comments

Comments
 (0)