use DB connector instead of web API #158

Merged
nikooo777 merged 11 commits from chainquery-db-connection into master 2019-10-31 20:57:53 +01:00
3 changed files with 4 additions and 2 deletions
Showing only changes of commit 469ac7329a - Show all commits

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ npm-debug.log
claimTrieCache.json claimTrieCache.json
syncState.json syncState.json
yarn-error.log yarn-error.log
chainquery-config.json

View file

@ -12,8 +12,8 @@ require('winston-daily-rotate-file');
// Setup logging // Setup logging
winston.remove(winston.transports.Console); winston.remove(winston.transports.Console);
winston.add(winston.transports.Console, { colorize: true, timestamp: true, prettyPrint: true }); winston.add(winston.transports.Console, { colorize: true, timestamp: true, prettyPrint: true });
var slackAPIKey = process.env.SLACK_HOOK_URL; let slackAPIKey = process.env.SLACK_HOOK_URL;
var mySlack = new slack(slackAPIKey, {}); let mySlack = new slack(slackAPIKey, {});
// Create Koa Application // Create Koa Application
const app = new Koa(); const app = new Koa();

View file

@ -207,6 +207,7 @@ function getClaimsSince (time, lastID, MaxClaimsInCall) {
console.log(query); console.log(query);
connection.query(query, function (err, results, fields) { connection.query(query, function (err, results, fields) {
if (err) { if (err) {
console.error(err);
logErrorToSlack('[Importer] Error getting updated claims. ' + err); logErrorToSlack('[Importer] Error getting updated claims. ' + err);
return reject(err); return reject(err);
} }