1
0
Fork 0
mirror of synced 2024-07-11 01:06:04 +12:00
This commit is contained in:
Adria Navarro 2023-12-21 18:29:57 +01:00
parent 92f1107e6c
commit 494a2ff91f

View file

@ -17,6 +17,7 @@ const start = Date.now()
async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
let i = 0
let errors = 0
async function createSingleRow(item) {
try {
const row = await createRow(apiKey, appId, table, item)
@ -27,7 +28,7 @@ async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
)
return row
} catch {
console.error("Error creating row", item)
errors++
}
}
@ -37,6 +38,9 @@ async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
const batchRows = await Promise.all(batchPromises)
rows.push(...batchRows)
}
if (errors) {
console.error(`Error creating ${errors} row`)
}
return rows
}