Debug logs
gitea/salix/pipeline/head Something is wrong with the build of this commit
Details
gitea/salix/pipeline/head Something is wrong with the build of this commit
Details
This commit is contained in:
parent
8f86cacc96
commit
48916e2b07
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue