Removed debug logs
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b499de7c08
commit
4251b0baeb
|
@ -211,22 +211,13 @@ module.exports = Self => {
|
|||
const toTable = table.toTable;
|
||||
const baseName = table.fileName;
|
||||
|
||||
console.log(`Starting transaction...`);
|
||||
// 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]);
|
||||
|
||||
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}...`);
|
||||
|
||||
|
@ -242,13 +233,6 @@ module.exports = Self => {
|
|||
`, [new Date(), baseName], options);
|
||||
}
|
||||
|
||||
// await tx.commit();
|
||||
// console.log(`Closed transaction`);
|
||||
// } catch (error) {
|
||||
// await tx.rollback();
|
||||
// console.log(error);
|
||||
// throw error;
|
||||
// }
|
||||
console.log(`Updated table ${toTable}\n`);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue