This commit is contained in:
AJ ONeal 2016-09-08 17:49:37 -06:00
parent a43a8347a9
commit 1fbd2a4b71
2 changed files with 2 additions and 3 deletions

View File

@ -92,6 +92,7 @@ module.exports.create = function (opts) {
var PromiseA = opts.PromiseA || global.Promise || require('bluebird'); var PromiseA = opts.PromiseA || global.Promise || require('bluebird');
var init = false; var init = false;
opts._promise = PromiseA.resolve(opts.instance);
opts._promise.addWorker = function (w) { opts._promise.addWorker = function (w) {
if (!init) { if (!init) {
init = true; init = true;
@ -100,7 +101,5 @@ module.exports.create = function (opts) {
return opts.master.addWorker(w); return opts.master.addWorker(w);
}; };
opts._promise = PromiseA.resolve(opts.instance);
return opts._promise; return opts._promise;
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "cluster-rpc", "name": "cluster-rpc",
"version": "1.0.1", "version": "1.0.2",
"description": "A simple way to wrap a single-instance module to enable it to work with node cluster.", "description": "A simple way to wrap a single-instance module to enable it to work with node cluster.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {