chore: post merge cleanup

This commit is contained in:
Fabio Di Stasio 2023-12-02 14:21:34 +01:00
parent 62614dceb9
commit 9ce53165e8
3 changed files with 14 additions and 12 deletions

View File

@ -237,7 +237,7 @@ export default (connections: {[key: string]: antares.Client}) => {
},
tables,
options: rest
}));
});
// Exporter message listener
exporter.stdout.on('data', (buff: Buffer) => {
@ -328,7 +328,7 @@ export default (connections: {[key: string]: antares.Client}) => {
type: 'init',
dbConfig,
options
}));
});
// Importer message listener
importer.stdout.on('data', (buff: Buffer) => {

View File

@ -39,7 +39,7 @@ const exportHandler = async (data: any) => {
parentPort.postMessage({
type: 'error',
payload: `"${client.name}" exporter not aviable`
}));
});
return;
}
@ -48,7 +48,7 @@ const exportHandler = async (data: any) => {
parentPort.postMessage({
type: 'error',
payload: err.toString()
}));
});
});
exporter.once('end', () => {
@ -67,7 +67,7 @@ const exportHandler = async (data: any) => {
parentPort.postMessage({
type: 'export-progress',
payload: state
}));
});
});
exporter.run();
@ -77,7 +77,7 @@ const exportHandler = async (data: any) => {
parentPort.postMessage({
type: 'error',
payload: err.toString()
}));
});
}
}
else if (type === 'cancel')

View File

@ -1,4 +1,6 @@
import SSHConfig from '@fabio286/ssh2-promise/lib/sshConfig';
import * as antares from 'common/interfaces/antares';
import { ImportOptions } from 'common/interfaces/importer';
import * as log from 'electron-log/main';
import * as mysql from 'mysql2';
import * as pg from 'pg';
@ -48,7 +50,7 @@ const importHandler = async (data: {
parentPort.postMessage({
type: 'error',
payload: `"${options.type}" importer not aviable`
}));
});
return;
}
@ -57,14 +59,14 @@ const importHandler = async (data: {
parentPort.postMessage({
type: 'error',
payload: err.toString()
}));
});
});
importer.once('end', () => {
parentPort.postMessage({
type: 'end',
payload: { cancelled: importer.isCancelled }
}));
});
});
importer.once('cancel', () => {
@ -75,14 +77,14 @@ const importHandler = async (data: {
parentPort.postMessage({
type: 'import-progress',
payload: state
}));
});
});
importer.on('query-error', state => {
parentPort.postMessage({
type: 'query-error',
payload: state
}));
});
});
importer.run();
@ -92,7 +94,7 @@ const importHandler = async (data: {
parentPort.postMessage({
type: 'error',
payload: err.toString()
}));
});
}
}
else if (type === 'cancel')