Skip to content

Commit

Permalink
Merge pull request #20 from Notastica/fix-npm-install
Browse files Browse the repository at this point in the history
fixing npm package
  • Loading branch information
Panthro committed Aug 16, 2016
2 parents 3ab7f35 + a90fe47 commit f17cf88
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 6 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "data-feed-orchestrator",
"version": "0.0.4",
"version": "0.0.5",
"description": "A data feed orchestrator",
"bin": "cli.js",
"main": "lib/index.js",
"files": [
"lib/",
"cli.js"
"lib/"
],
"keywords": [
"big data",
Expand Down
30 changes: 30 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Orchestrator from './orchestrator';
import logger from './logging/logger';
import uuid from 'node-uuid';
import * as mq from './mq/connection';

const o = new Orchestrator({
registerQueue: uuid.v4(),
messagesQueue: uuid.v4(),
messagesIndex: uuid.v4()
});

mq.connect(o.amqpURL).then((context) => {
const pub = context.socket('PUSH');
const messageSent = { uuid: uuid.v4() };

pub.connect(o.messagesQueue);
pub.write(JSON.stringify(messageSent));

})
.then(() => {
return o.listen();
})
.then(() => {
logger.info(`Orchestrator ${o.name} ready to receive new modules in the queue ${o.registerQueue}`);
});

process.on('SIGINT', function () {
logger.warn('Gracefully shutting down from SIGINT (Ctrl-C)');
o.shutdown();
});
2 changes: 1 addition & 1 deletion src/es/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import elasticsearch from 'elasticsearch';
import isProd from 'isprod';
import Promise from 'bluebird';

const defaultOptions = { log: isProd ? 'warn' : 'info' };
const defaultOptions = { log: isProd ? 'warning' : 'info' };

/**
* Creates an elastic connection
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import O from './orchestrator';
import M from './module';

export const Orchestrator = O;
export const Module = M;
2 changes: 1 addition & 1 deletion src/logging/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as winston from 'winston';
import isProd from 'isprod';

const level = process.env.NODE_ENV === 'test' || !isProd ? 'debug' : 'info';
const level = isProd ? 'info' : 'debug';

export const logger = new winston.Logger({
level: level,
Expand Down

0 comments on commit f17cf88

Please sign in to comment.