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

Prevent one single request to stop the process

This commit is contained in:
Adria Navarro 2023-12-21 18:28:10 +01:00
parent c518d8a7fa
commit 92f1107e6c

View file

@ -18,13 +18,17 @@ async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
let i = 0
async function createSingleRow(item) {
const row = await createRow(apiKey, appId, table, item)
console.log(
`${table.name} - ${++i} of ${items.length} created (${
(Date.now() - start) / 1000
}s)`
)
return row
try {
const row = await createRow(apiKey, appId, table, item)
console.log(
`${table.name} - ${++i} of ${items.length} created (${
(Date.now() - start) / 1000
}s)`
)
return row
} catch {
console.error("Error creating row", item)
}
}
const rows = []