-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (34 loc) · 973 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const config = require("./config");
const logger = require("./common/logger");
const mysql = require("./common/mysql");
const elasticsearch = require("./common/elasticsearch");
const etl = require("./etl");
const runCCDCETL = async function(){
try {
const elasticsearchConnected = await elasticsearch.testConnection();
if(elasticsearchConnected){
logger.info("Elasticsearch connected!");
}
else{
logger.info("Failed to connect to Elasticsearch.");
}
}
catch(error) {
logger.error(error);
}
try{
const mysqlConnected = await mysql.query("select 1 as c1");
if(mysqlConnected[0].c1){
logger.info("Relational DB connected!");
}
else{
logger.info("Failed to connect to Relational Database.");
}
}
catch(error) {
logger.error(error);
}
await etl.startEtl();
etl.endEtl();
};
runCCDCETL();