From 31c01e0a6b8338aa6c58772ff572e08c16bf6620 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 22 Dec 2023 10:05:49 +0100 Subject: [PATCH] Display errors --- .../server/scripts/load/create-many-relationships.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/server/scripts/load/create-many-relationships.js b/packages/server/scripts/load/create-many-relationships.js index 0f4fe3470c..14eaccd99c 100755 --- a/packages/server/scripts/load/create-many-relationships.js +++ b/packages/server/scripts/load/create-many-relationships.js @@ -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 }