Project renamed
This commit is contained in:
parent
f5b84e338f
commit
916e92c940
10
index.js
10
index.js
|
@ -2,7 +2,7 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const defaultConfig = require('./config.json');
|
||||
const DbAsync = require('./db-async');
|
||||
const MyCDC = require('./mycdc');
|
||||
|
||||
const config = Object.assign({}, defaultConfig);
|
||||
const localPath = path.join(__dirname, 'config.local.json');
|
||||
|
@ -11,16 +11,16 @@ if (fs.existsSync(localPath)) {
|
|||
Object.assign(config, localConfig);
|
||||
}
|
||||
|
||||
let dbAsync;
|
||||
let mycdc;
|
||||
|
||||
async function main() {
|
||||
dbAsync = new DbAsync(config)
|
||||
await dbAsync.start();
|
||||
mycdc = new MyCDC(config)
|
||||
await mycdc.start();
|
||||
|
||||
process.on('SIGINT', async function() {
|
||||
console.log('Got SIGINT.');
|
||||
try {
|
||||
await dbAsync.stop();
|
||||
await mycdc.stop();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ const allEvents = new Set([
|
|||
'deleterows'
|
||||
]);
|
||||
|
||||
module.exports = class DbAsync {
|
||||
module.exports = class MyCDC {
|
||||
constructor(config) {
|
||||
this.config = config;
|
||||
this.running = false;
|
Loading…
Reference in New Issue