Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster, logger: support for akyuu.startCluster() #28

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions example/demo/src/config/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ module.exports = {
autoStatusCode: true
},

cluster: {
workerCount: 2,
entry: path.join(__dirname, "../../app.js"),
limit: 2
},

test: {
test1: true
},
Expand Down
10 changes: 10 additions & 0 deletions example/demo/src/master.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* XadillaX <[email protected]> created at 2017-07-28 15:32:46 with ❤
*
* Copyright (c) 2017 xcoder.in, all rights reserved.
*/
"use strict";

const akyuu = require("../../../");

akyuu.startCluster();
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ akyuu.Validator = require("joi");
akyuu.Service = require("./lib/requester");

module.exports = akyuu;

akyuu.startCluster = require("akyuu-cluster").startCluster.bind(akyuu, __dirname);
1 change: 1 addition & 0 deletions lib/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Logger {
};

for(let i = 0; i < this.transportConfig.length; i++) {
if(this.transportConfig[i].enabled === false) continue;
const type = _.startCase(this.transportConfig[i].type);
const transportOption = Object.assign({}, this.transportConfig[i], {
timestamp: _timestamp,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"homepage": "https://github.com/akyuujs/akyuu#readme",
"dependencies": {
"akyuu-cluster": "^1.0.0",
"async": "^2.1.5",
"case": "^1.5.2",
"config": "^1.20.1",
Expand Down