diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index 7f4f0b5e7..b6b06e19f 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -202,16 +202,20 @@ module.exports = Self => { const baseName = table.fileName; const tx = await Self.beginTransaction({}); - + console.log(`Started transaction`); try { const options = {transaction: tx}; + console.log(`Emptying table ${toTable}...`); const tableName = `edi.${toTable}`; await Self.rawSql(`DELETE FROM ??`, [tableName], options); + console.log(`Reading files...`); const dirFiles = await fs.readdir(tempDir); const files = dirFiles.filter(file => file.startsWith(baseName)); + console.log('Files to import: ' + files.join(', ')); + for (const file of files) { console.log(`Dumping data from file ${file}...`); @@ -228,6 +232,7 @@ module.exports = Self => { } await tx.commit(); + console.log(`Closed transaction`); } catch (error) { await tx.rollback(); throw error;