Commit 237447ca authored by Tobias Steiner's avatar Tobias Steiner
Browse files

Change strategy for polling data

parent 75d256fe
......@@ -31,12 +31,9 @@ kafka.init().then(() => {
/**
* Get next from kafka
*/
let index: Timer;
const next = () => {
index = setInterval(() => {
// start consuming
consumer.consume(1);
}, 5);
};
next();
......@@ -45,7 +42,6 @@ kafka.init().then(() => {
*/
consumer.on('data', (rawData) => {
core.getLogger().info('Consumed some data');
clearInterval(index);
core.getReporter().setDataIn(1);
// create new node
// rawData.parsed.provider = 'geonames';
......
......@@ -10,7 +10,6 @@ export class Linker {
this.nconf = nconf;
this.logger = logger;
this.uriBuilder = uriBuilder;
console.log(nconf.get('neo4j'));
this.driver = neo4j.driver(
nconf.get('neo4j:config:uri'),
neo4j.auth.basic(
......@@ -54,7 +53,10 @@ export class Linker {
session.close();
resolve();
}).catch((err) => {
throw err;
setTimeout(() => {
session.close();
reject(`Error while saving a connection to neo4j ${JSON.stringify(err)}`);
}, 1000);
});
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment