Skip to content

Commit

Permalink
Update oih libs version and refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
heggert committed Jan 25, 2021
1 parent 3ef80d9 commit 474f6bd
Show file tree
Hide file tree
Showing 3 changed files with 528 additions and 443 deletions.
6 changes: 3 additions & 3 deletions services/reports-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "Apache-2.0",
"scripts": {
"start": "node src/index.js",
"start:container": "nodemon src/index.js --watch src/",
"start:container": "nodemon src/index.js --watch src/ --watch ../../lib/event-bus/src",
"test": "jest",
"watch": "nodemon src/index.js",
"coverage": "yarn test --coverage",
Expand All @@ -22,8 +22,8 @@
"stop-dev": "yarn stop-dev-ts && yarn stop-dev-mongo && yarn stop-dev-rabbitmq"
},
"dependencies": {
"@basaas/node-logger": "1.1.5",
"@openintegrationhub/event-bus": "1.2.0",
"@basaas/node-logger": "*",
"@openintegrationhub/event-bus": "*",
"dotenv": "8.2.0",
"express": "4.17.1",
"influx": "5.6.3",
Expand Down
4 changes: 3 additions & 1 deletion services/reports-analytics/src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = class Server {
async setupExpress() {
this.app = express();
this.app.disable('x-powered-by');
this.app.use('/healthcheck', require('./../route/healthcheck'));
this.app.use('/healthcheck', require('../route/healthcheck'));
this.app.use('/grafana-proxy', require('../route/grafana-proxy'));
}

Expand Down Expand Up @@ -108,13 +108,15 @@ module.exports = class Server {
timestamp: `${event.createdAt}000000`,
});
}
console.log(payload);
await this.influx.writePoints(payload);
} catch (err) {
logger.error(err);
}
}

async handleEvent(event) {
console.log(event.name);
this.writeTs(event, this.eventMap.get(event.name));
}

Expand Down
Loading

0 comments on commit 474f6bd

Please sign in to comment.