1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Display errors

This commit is contained in:
Adria Navarro 2023-12-22 10:05:49 +01:00
parent abf025b3f7
commit 31c01e0a6b

View file

@ -2,6 +2,7 @@
const { createApp, getTable, createRow, createTable } = require("./utils")
const Chance = require("chance")
const generator = new Chance()
const STUDENT_COUNT = 500
@ -13,7 +14,7 @@ if (!process.argv[2]) {
}
const start = Date.now()
async function batchCreate(apiKey, appId, table, items, batchSize = 10) {
async function batchCreate(apiKey, appId, table, items, batchSize = 1000) {
let i = 0
let errors = 0
@ -51,6 +52,14 @@ async function batchCreate(apiKey, appId, table, items, batchSize = 10) {
await Promise.all(Object.values(inFlight))
if (errors) {
console.error(
`${table.name} - ${errors} creation errored (${
(Date.now() - start) / 1000
}s)`
)
}
return rows
}