From 86f0dc0a4e47ccd59e761e51f56a76002b729c60 Mon Sep 17 00:00:00 2001 From: Tereshchenko Aleksandr Date: Thu, 13 Jun 2024 14:55:14 +0300 Subject: [PATCH] More debug logging --- importer-mankeli/src/utils/db.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/importer-mankeli/src/utils/db.js b/importer-mankeli/src/utils/db.js index 7922b6d2..2f28f203 100644 --- a/importer-mankeli/src/utils/db.js +++ b/importer-mankeli/src/utils/db.js @@ -9,16 +9,19 @@ const bulkCreate = async (model, entities, transaction, properties = ['id']) => try { await model.bulkCreate(entities, { updateOnDuplicate: getColumnsToUpdate(model, properties), - transaction + transaction, + logging: logger.info }) } catch (error) { + logger.info(getColumnsToUpdate(model, properties)) logger.error(error) // If one fails on bulkCreate, re-do them individually and report the individual failures. for (const entity of entities) { try { await model.upsert(entity, { updateOnDuplicate: getColumnsToUpdate(model, properties), - transaction + transaction, + logging: logger.info }) } catch (e) { logger.error(e)