mirror of https://github.com/Fabio286/antares.git
chore: post merge cleanup
This commit is contained in:
parent
62614dceb9
commit
9ce53165e8
|
@ -237,7 +237,7 @@ export default (connections: {[key: string]: antares.Client}) => {
|
||||||
},
|
},
|
||||||
tables,
|
tables,
|
||||||
options: rest
|
options: rest
|
||||||
}));
|
});
|
||||||
|
|
||||||
// Exporter message listener
|
// Exporter message listener
|
||||||
exporter.stdout.on('data', (buff: Buffer) => {
|
exporter.stdout.on('data', (buff: Buffer) => {
|
||||||
|
@ -328,7 +328,7 @@ export default (connections: {[key: string]: antares.Client}) => {
|
||||||
type: 'init',
|
type: 'init',
|
||||||
dbConfig,
|
dbConfig,
|
||||||
options
|
options
|
||||||
}));
|
});
|
||||||
|
|
||||||
// Importer message listener
|
// Importer message listener
|
||||||
importer.stdout.on('data', (buff: Buffer) => {
|
importer.stdout.on('data', (buff: Buffer) => {
|
||||||
|
|
|
@ -39,7 +39,7 @@ const exportHandler = async (data: any) => {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
payload: `"${client.name}" exporter not aviable`
|
payload: `"${client.name}" exporter not aviable`
|
||||||
}));
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ const exportHandler = async (data: any) => {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
payload: err.toString()
|
payload: err.toString()
|
||||||
}));
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
exporter.once('end', () => {
|
exporter.once('end', () => {
|
||||||
|
@ -67,7 +67,7 @@ const exportHandler = async (data: any) => {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'export-progress',
|
type: 'export-progress',
|
||||||
payload: state
|
payload: state
|
||||||
}));
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
exporter.run();
|
exporter.run();
|
||||||
|
@ -77,7 +77,7 @@ const exportHandler = async (data: any) => {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
payload: err.toString()
|
payload: err.toString()
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type === 'cancel')
|
else if (type === 'cancel')
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
import SSHConfig from '@fabio286/ssh2-promise/lib/sshConfig';
|
||||||
import * as antares from 'common/interfaces/antares';
|
import * as antares from 'common/interfaces/antares';
|
||||||
|
import { ImportOptions } from 'common/interfaces/importer';
|
||||||
import * as log from 'electron-log/main';
|
import * as log from 'electron-log/main';
|
||||||
import * as mysql from 'mysql2';
|
import * as mysql from 'mysql2';
|
||||||
import * as pg from 'pg';
|
import * as pg from 'pg';
|
||||||
|
@ -48,7 +50,7 @@ const importHandler = async (data: {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
payload: `"${options.type}" importer not aviable`
|
payload: `"${options.type}" importer not aviable`
|
||||||
}));
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,14 +59,14 @@ const importHandler = async (data: {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
payload: err.toString()
|
payload: err.toString()
|
||||||
}));
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
importer.once('end', () => {
|
importer.once('end', () => {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'end',
|
type: 'end',
|
||||||
payload: { cancelled: importer.isCancelled }
|
payload: { cancelled: importer.isCancelled }
|
||||||
}));
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
importer.once('cancel', () => {
|
importer.once('cancel', () => {
|
||||||
|
@ -75,14 +77,14 @@ const importHandler = async (data: {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'import-progress',
|
type: 'import-progress',
|
||||||
payload: state
|
payload: state
|
||||||
}));
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
importer.on('query-error', state => {
|
importer.on('query-error', state => {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'query-error',
|
type: 'query-error',
|
||||||
payload: state
|
payload: state
|
||||||
}));
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
importer.run();
|
importer.run();
|
||||||
|
@ -92,7 +94,7 @@ const importHandler = async (data: {
|
||||||
parentPort.postMessage({
|
parentPort.postMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
payload: err.toString()
|
payload: err.toString()
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type === 'cancel')
|
else if (type === 'cancel')
|
||||||
|
|
Loading…
Reference in New Issue